mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-11-24 16:17:22 +00:00
The preamble search of the CNAV message decoder (libswiftcnav) started at position 1 of the decoded bits buffer and stopped one window short of its end, and when it found nothing it kept the last 7 bits, which became positions 0 to 6 of the next search. The Viterbi decoder delivers 32 bits at a time, so every search saw 39 bits and tested the windows starting at 1 to 30. A preamble starting at position 31 was complete in the buffer but not tested, and lost its first bit in the shift; one starting at position 32 landed at position 0 of the next search, which was skipped. For 2 of the 32 positions of the preamble with respect to the 32-bit blocks, the first message after the start of tracking was lost although all its symbols were received. With a short capture this can leave a GPS L2C or L5 satellite without the MT10, MT11 and clock messages needed for an ephemeris set. Skipping position 0 is right only when the search follows a CRC failure, where the buffer starts with the preamble pattern that has just been rejected. Test every complete 8-bit window, from position 0 to n_decoded - 8, and skip position 0 only in that rescan (new skip_first flag of cnav_v27_part_t, set where the CRC failure is handled and cleared by the search). The new unit tests encode two consecutive CNAV messages (CRC-24Q, rate 1/2 K=7 convolutional code) and feed them to the decoder with the first preamble at each of the 32 positions, for both symbol-pair phases and both polarities, and with a preamble pattern that fails the CRC check at each distance from 8 to 371 bits ahead of the first message. Signed-off-by: Ben Gant <indigma04@gmail.com>
72 lines
4.0 KiB
C++
72 lines
4.0 KiB
C++
/*!
|
|
* \file unit_tests_core.cc
|
|
* \brief Unit tests for arithmetic, control plane, adapters, libs, resamplers, sources, filters and telemetry decoders.
|
|
* \author Carles Fernandez-Prades, 2026 cfernandez(at)cttc.es
|
|
*
|
|
* This translation unit #includes the test sources of its category so that
|
|
* they are compiled together into the run_tests executable. Splitting the
|
|
* tests into several aggregate units (instead of a single one) keeps the
|
|
* per-unit size, and hence the compiler's memory and time, bounded.
|
|
*
|
|
* -----------------------------------------------------------------------------
|
|
*
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
|
* This file is part of GNSS-SDR.
|
|
*
|
|
* Copyright (C) 2010-2026 (see AUTHORS file for a list of contributors)
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
|
|
#include "unit_tests_common.h"
|
|
#include "unit-tests/arithmetic/matio_test.cc"
|
|
|
|
#if !UNIT_TESTING_MINIMAL
|
|
|
|
#include "unit-tests/arithmetic/code_generation_test.cc"
|
|
#include "unit-tests/arithmetic/complex_carrier_test.cc"
|
|
#include "unit-tests/arithmetic/conjugate_test.cc"
|
|
#include "unit-tests/arithmetic/fft_speed_test.cc"
|
|
#include "unit-tests/arithmetic/magnitude_squared_test.cc"
|
|
#include "unit-tests/arithmetic/multiply_test.cc"
|
|
#include "unit-tests/arithmetic/preamble_correlator_test.cc"
|
|
#include "unit-tests/control-plane/galileo_tow_history_test.cc"
|
|
#include "unit-tests/control-plane/gnss_synchro_monitor_test.cc"
|
|
#include "unit-tests/control-plane/in_memory_configuration_test.cc"
|
|
#include "unit-tests/control-plane/protobuf_test.cc"
|
|
#include "unit-tests/control-plane/satellite_visibility_test.cc"
|
|
#include "unit-tests/control-plane/string_converter_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/adapter/adapter_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/adapter/pass_through_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/libs/beidou_b1c_signal_replica_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/libs/beidou_b2a_signal_replica_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/libs/gps_l1c_signal_replica_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/libs/rtklib_lli_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/observables/deterministic_observables_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/telemetry_decoder/deterministic_telemetry_fault_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/telemetry_decoder/gps_cnav_msg_decoder_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1c_telemetry_decoder_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/telemetry_decoder/sbas_l1_telemetry_decoder_test.cc"
|
|
|
|
#ifndef EXCLUDE_TESTS_REQUIRING_BINARIES
|
|
#include "unit-tests/control-plane/control_thread_test.cc"
|
|
#include "unit-tests/control-plane/file_configuration_test.cc"
|
|
#include "unit-tests/control-plane/gnss_block_factory_test.cc"
|
|
#include "unit-tests/control-plane/gnss_flowgraph_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/filter/fir_filter_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/filter/notch_filter_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc"
|
|
#include "unit-tests/signal-processing-blocks/sources/labsat23_source_test.cc"
|
|
#endif
|
|
|
|
#endif // !UNIT_TESTING_MINIMAL
|