2012-06-22 14:17:28 +00:00
|
|
|
/*!
|
|
|
|
* \file gnss_block_factory_test.cc
|
2012-09-12 15:03:38 +00:00
|
|
|
* \brief This class implements a Unit Test for the GNSSBlockFactory class.
|
|
|
|
* \authors <ul>
|
2014-03-23 09:45:03 +00:00
|
|
|
* <li> Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
2012-09-12 15:03:38 +00:00
|
|
|
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
|
|
|
* </ul>
|
|
|
|
*
|
|
|
|
* This class test the instantiation of all blocks in gnss_block_factory
|
2012-06-22 14:17:28 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2012-06-22 14:17:28 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2012-06-22 14:17:28 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2012-06-22 14:17:28 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
2012-06-22 14:17:28 +00:00
|
|
|
#include "acquisition_interface.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "channel.h"
|
2019-07-17 13:56:30 +00:00
|
|
|
#include "concurrent_queue.h"
|
2019-07-26 10:38:20 +00:00
|
|
|
#include "gnss_block_factory.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "gnss_block_interface.h"
|
2020-07-12 10:46:13 +00:00
|
|
|
#include "gnss_sdr_make_unique.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "in_memory_configuration.h"
|
2012-06-22 14:17:28 +00:00
|
|
|
#include "observables_interface.h"
|
|
|
|
#include "pvt_interface.h"
|
2021-02-15 23:34:16 +00:00
|
|
|
#include "signal_source_interface.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "tracking_interface.h"
|
|
|
|
#include <gtest/gtest.h>
|
2019-07-17 13:56:30 +00:00
|
|
|
#include <pmt/pmt.h>
|
2023-12-01 09:19:39 +00:00
|
|
|
#include <utility>
|
2018-12-09 21:00:09 +00:00
|
|
|
#include <vector>
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("SignalSource.implementation", "File_Signal_Source");
|
2014-03-23 09:45:03 +00:00
|
|
|
std::string path = std::string(TEST_PATH);
|
|
|
|
std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
|
2023-12-01 09:19:39 +00:00
|
|
|
configuration->set_property("SignalSource.filename", std::move(filename));
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2014-04-11 18:18:59 +00:00
|
|
|
// Example of a factory as a shared_ptr
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
2014-04-11 18:18:59 +00:00
|
|
|
// Example of a block as a shared_ptr
|
2021-02-09 22:47:34 +00:00
|
|
|
auto signal_source = factory->GetSignalSource(configuration.get(), queue.get());
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("SignalSource", signal_source->role().c_str());
|
|
|
|
EXPECT_STREQ("File_Signal_Source", signal_source->implementation().c_str());
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongSignalSource)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2021-02-27 10:05:39 +00:00
|
|
|
configuration->set_property("SignalSource.implementation", "Parapsychological_Source");
|
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
|
|
|
// Example of a factory as a unique_ptr
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
// Example of a block as a unique_ptr
|
|
|
|
auto signal_source = factory->GetSignalSource(configuration.get(), queue.get());
|
|
|
|
EXPECT_EQ(nullptr, signal_source);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongSignalSource2)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("SignalSource.implementation", "Pass_Through");
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2014-04-11 18:18:59 +00:00
|
|
|
// Example of a factory as a unique_ptr
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2014-04-11 18:18:59 +00:00
|
|
|
// Example of a block as a unique_ptr
|
2021-02-09 22:47:34 +00:00
|
|
|
auto signal_source = factory->GetSignalSource(configuration.get(), queue.get());
|
2014-04-11 18:18:59 +00:00
|
|
|
EXPECT_EQ(nullptr, signal_source);
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|
|
|
|
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateSignalConditioner)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("SignalConditioner.implementation", "Signal_Conditioner");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-06-18 09:49:28 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> signal_conditioner = factory->GetSignalConditioner(configuration.get());
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("SignalConditioner", signal_conditioner->role().c_str());
|
|
|
|
EXPECT_STREQ("Signal_Conditioner", signal_conditioner->implementation().c_str());
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongSignalConditioner)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("SignalConditioner.implementation", "Signal_Ruinder");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::unique_ptr<GNSSBlockInterface> signal_conditioner = factory->GetSignalConditioner(configuration.get());
|
|
|
|
EXPECT_EQ(nullptr, signal_conditioner);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongSignalConditioner2)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("SignalConditioner.implementation", "Fir_Filter");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::unique_ptr<GNSSBlockInterface> signal_conditioner = factory->GetSignalConditioner(configuration.get());
|
|
|
|
EXPECT_EQ(nullptr, signal_conditioner);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateFIRFilter)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("InputFilter.implementation", "Fir_Filter");
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("InputFilter.number_of_taps", "4");
|
|
|
|
configuration->set_property("InputFilter.number_of_bands", "2");
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("InputFilter.band1_begin", "0.0");
|
|
|
|
configuration->set_property("InputFilter.band1_end", "0.45");
|
|
|
|
configuration->set_property("InputFilter.band2_begin", "0.55");
|
|
|
|
configuration->set_property("InputFilter.band2_end", "1.0");
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("InputFilter.ampl1_begin", "1.0");
|
|
|
|
configuration->set_property("InputFilter.ampl1_end", "1.0");
|
|
|
|
configuration->set_property("InputFilter.ampl2_begin", "0.0");
|
|
|
|
configuration->set_property("InputFilter.ampl2_end", "0.0");
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("InputFilter.band1_error", "1.0");
|
|
|
|
configuration->set_property("InputFilter.band2_error", "1.0");
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("InputFilter.filter_type", "bandpass");
|
|
|
|
configuration->set_property("InputFilter.grid_density", "16");
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration.get(), "InputFilter", 1, 1);
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
|
|
|
EXPECT_STREQ("Fir_Filter", input_filter->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2012-07-18 13:29:18 +00:00
|
|
|
|
|
|
|
configuration->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
|
|
|
|
|
|
|
|
configuration->set_property("InputFilter.number_of_taps", "4");
|
|
|
|
configuration->set_property("InputFilter.number_of_bands", "2");
|
|
|
|
|
|
|
|
configuration->set_property("InputFilter.band1_begin", "0.0");
|
|
|
|
configuration->set_property("InputFilter.band1_end", "0.45");
|
|
|
|
configuration->set_property("InputFilter.band2_begin", "0.55");
|
|
|
|
configuration->set_property("InputFilter.band2_end", "1.0");
|
|
|
|
|
|
|
|
configuration->set_property("InputFilter.ampl1_begin", "1.0");
|
|
|
|
configuration->set_property("InputFilter.ampl1_end", "1.0");
|
|
|
|
configuration->set_property("InputFilter.ampl2_begin", "0.0");
|
|
|
|
configuration->set_property("InputFilter.ampl2_end", "0.0");
|
|
|
|
|
|
|
|
configuration->set_property("InputFilter.band1_error", "1.0");
|
|
|
|
configuration->set_property("InputFilter.band2_error", "1.0");
|
|
|
|
|
|
|
|
configuration->set_property("InputFilter.filter_type", "bandpass");
|
|
|
|
configuration->set_property("InputFilter.grid_density", "16");
|
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
configuration->set_property("InputFilter.sampling_frequency", "4000000");
|
|
|
|
configuration->set_property("InputFilter.IF", "34000");
|
2021-02-27 10:05:39 +00:00
|
|
|
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration.get(), "InputFilter", 1, 1);
|
2012-07-18 13:29:18 +00:00
|
|
|
|
|
|
|
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
|
|
|
EXPECT_STREQ("Freq_Xlating_Fir_Filter", input_filter->implementation().c_str());
|
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2017-10-13 14:21:26 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2017-10-13 14:21:26 +00:00
|
|
|
configuration->set_property("InputFilter.implementation", "Pulse_Blanking_Filter");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration.get(), "InputFilter", 1, 1);
|
2017-10-13 14:21:26 +00:00
|
|
|
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
|
|
|
EXPECT_STREQ("Pulse_Blanking_Filter", input_filter->implementation().c_str());
|
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2017-10-13 14:21:26 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateNotchFilter)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2017-10-13 14:21:26 +00:00
|
|
|
configuration->set_property("InputFilter.implementation", "Notch_Filter");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration.get(), "InputFilter", 1, 1);
|
2017-10-13 14:21:26 +00:00
|
|
|
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
|
|
|
EXPECT_STREQ("Notch_Filter", input_filter->implementation().c_str());
|
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2017-10-13 14:21:26 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateNotchFilterLite)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2017-10-13 14:21:26 +00:00
|
|
|
configuration->set_property("InputFilter.implementation", "Notch_Filter_Lite");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration.get(), "InputFilter", 1, 1);
|
2017-10-13 14:21:26 +00:00
|
|
|
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
|
|
|
EXPECT_STREQ("Notch_Filter_Lite", input_filter->implementation().c_str());
|
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongFilter)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
|
|
|
configuration->set_property("InputFilter.implementation", "Pollen_Filter");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration.get(), "InputFilter", 1, 1);
|
|
|
|
EXPECT_EQ(nullptr, input_filter);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateDirectResampler)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("Resampler.implementation", "Direct_Resampler");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> resampler = factory->GetBlock(configuration.get(), "Resampler", 1, 1);
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("Resampler", resampler->role().c_str());
|
|
|
|
EXPECT_STREQ("Direct_Resampler", resampler->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongResampler)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Resampler.implementation", "RaNdOm_Resampler");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::unique_ptr<GNSSBlockInterface> resampler = factory->GetBlock(configuration.get(), "Resampler", 1, 1);
|
|
|
|
EXPECT_EQ(nullptr, resampler);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPcpsAcquisition)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration.get(), "Acquisition", 1, 0);
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
|
|
|
EXPECT_STREQ("GPS_L1_CA_PCPS_Acquisition", acquisition->implementation().c_str());
|
2014-07-23 23:38:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPcpsQuickSyncAcquisition)
|
2014-07-23 23:38:58 +00:00
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition");
|
|
|
|
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration.get(), "Acquisition", 1, 0);
|
2014-07-23 23:38:58 +00:00
|
|
|
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
|
|
|
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
|
|
|
EXPECT_STREQ("GPS_L1_CA_PCPS_QuickSync_Acquisition", acquisition->implementation().c_str());
|
|
|
|
}
|
|
|
|
|
2020-07-13 13:17:15 +00:00
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGalileoE1PcpsQuickSyncAmbiguousAcquisition)
|
2014-07-23 23:38:58 +00:00
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition");
|
|
|
|
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration.get(), "Acquisition", 1, 0);
|
2014-07-23 23:38:58 +00:00
|
|
|
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
|
|
|
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
|
|
|
EXPECT_STREQ("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", acquisition->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
2012-09-03 11:58:28 +00:00
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGalileoE1PcpsAmbiguousAcquisition)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2012-09-03 11:58:28 +00:00
|
|
|
configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration.get(), "Acquisition", 1, 0);
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
2012-09-03 11:58:28 +00:00
|
|
|
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
|
|
|
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
|
|
|
|
}
|
2012-06-22 14:17:28 +00:00
|
|
|
|
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongAcquisition)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Alchemy");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration.get(), "Acquisition", 1, 0);
|
|
|
|
EXPECT_EQ(nullptr, acq_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaDllPllTracking)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration.get(), "Tracking", 1, 1);
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
|
|
|
EXPECT_STREQ("GPS_L1_CA_DLL_PLL_Tracking", tracking->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaTcpConnectorTracking)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("Tracking.implementation", "GPS_L1_CA_TCP_CONNECTOR_Tracking");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration.get(), "Tracking", 1, 1);
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
|
|
|
EXPECT_STREQ("GPS_L1_CA_TCP_CONNECTOR_Tracking", tracking->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
2012-09-03 11:58:28 +00:00
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGalileoE1DllPllVemlTracking)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2012-09-03 11:58:28 +00:00
|
|
|
configuration->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration.get(), "Tracking", 1, 1);
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
|
2012-09-03 11:58:28 +00:00
|
|
|
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
|
|
|
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
|
|
|
|
}
|
|
|
|
|
2012-06-22 14:17:28 +00:00
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongTracking)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Tracking.implementation", "The perfect tracking");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration.get(), "Tracking", 1, 1);
|
|
|
|
EXPECT_EQ(nullptr, trk_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaTelemetryDecoder)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-07-13 13:17:15 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> telemetry_decoder = factory->GetBlock(configuration.get(), "TelemetryDecoder", 1, 1);
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("TelemetryDecoder", telemetry_decoder->role().c_str());
|
|
|
|
EXPECT_STREQ("GPS_L1_CA_Telemetry_Decoder", telemetry_decoder->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
2014-04-11 18:18:59 +00:00
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongTelemetryDecoder)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("TelemetryDecoder.implementation", "GPS_Xenomorphic_Telemetry_Decoder");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::shared_ptr<GNSSBlockInterface> telemetry_decoder = factory->GetBlock(configuration.get(), "TelemetryDecoder", 1, 1);
|
|
|
|
EXPECT_EQ(nullptr, telemetry_decoder);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateEmptyTelemetryDecoder)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("TelemetryDecoder.implementation", std::string(""));
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::shared_ptr<GNSSBlockInterface> telemetry_decoder = factory->GetBlock(configuration.get(), "TelemetryDecoder", 1, 1);
|
|
|
|
EXPECT_EQ(nullptr, telemetry_decoder);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateChannels)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2016-04-25 14:20:14 +00:00
|
|
|
configuration->set_property("Channels_1C.count", "2");
|
|
|
|
configuration->set_property("Channels_1E.count", "0");
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("Channels.in_acquisition", "2");
|
2021-02-27 10:05:39 +00:00
|
|
|
configuration->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
|
2019-06-11 08:11:20 +00:00
|
|
|
configuration->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
|
2018-03-03 01:03:39 +00:00
|
|
|
configuration->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
|
2019-07-17 13:56:30 +00:00
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-06-18 09:49:28 +00:00
|
|
|
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = factory->GetChannels(configuration.get(), queue.get());
|
2017-08-18 11:11:12 +00:00
|
|
|
EXPECT_EQ(static_cast<unsigned int>(2), channels->size());
|
2014-04-11 18:18:59 +00:00
|
|
|
channels->erase(channels->begin(), channels->end());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongObservables)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Observables.implementation", "Supercalifragilistic_Observables");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
auto observables = factory->GetObservables(configuration.get());
|
|
|
|
EXPECT_EQ(nullptr, observables);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongObservables2)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("Observables.implementation", "Pass_Through");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-06-18 09:49:28 +00:00
|
|
|
auto observables = factory->GetObservables(configuration.get());
|
2021-02-27 10:05:39 +00:00
|
|
|
EXPECT_EQ(nullptr, observables);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongObservables3)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("Observables.implementation", "RTKLIB_PVT");
|
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
auto observables = factory->GetObservables(configuration.get());
|
|
|
|
EXPECT_EQ(nullptr, observables);
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-02-27 10:05:39 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateObservables)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2017-04-12 15:04:51 +00:00
|
|
|
configuration->set_property("Observables.implementation", "Hybrid_Observables");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-06-18 09:49:28 +00:00
|
|
|
std::unique_ptr<GNSSBlockInterface> observables = factory->GetObservables(configuration.get());
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("Observables", observables->role().c_str());
|
2017-04-12 15:04:51 +00:00
|
|
|
EXPECT_STREQ("Hybrid_Observables", observables->implementation().c_str());
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-01 18:52:03 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateRTKLIBPvt)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2018-03-01 18:52:03 +00:00
|
|
|
configuration->set_property("PVT.implementation", "RTKLIB_PVT");
|
2020-07-12 10:46:13 +00:00
|
|
|
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
|
2020-06-18 09:49:28 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration.get());
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<PvtInterface> pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("PVT", pvt->role().c_str());
|
2017-07-03 10:42:22 +00:00
|
|
|
EXPECT_STREQ("RTKLIB_PVT", pvt->implementation().c_str());
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-25 20:53:11 +00:00
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongPvt)
|
2012-10-28 08:43:48 +00:00
|
|
|
{
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
2013-02-17 09:54:41 +00:00
|
|
|
configuration->set_property("PVT.implementation", "Pepito");
|
2021-02-15 23:34:16 +00:00
|
|
|
auto factory = std::make_unique<GNSSBlockFactory>();
|
2021-02-16 00:15:38 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration.get());
|
|
|
|
auto pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
|
2014-04-11 18:18:59 +00:00
|
|
|
EXPECT_EQ(nullptr, pvt);
|
2012-06-22 14:17:28 +00:00
|
|
|
}
|
2021-02-27 10:05:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongPvt2)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("PVT.implementation", "Pass_Through");
|
|
|
|
auto factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration.get());
|
|
|
|
auto pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
|
|
|
|
EXPECT_EQ(nullptr, pvt);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(GNSSBlockFactoryTest, InstantiateWrongPvt3)
|
|
|
|
{
|
|
|
|
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
|
|
|
configuration->set_property("PVT.implementation", "Quantum_Particle_PVT");
|
|
|
|
auto factory = std::make_unique<GNSSBlockFactory>();
|
|
|
|
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration.get());
|
|
|
|
auto pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
|
|
|
|
EXPECT_EQ(nullptr, pvt);
|
|
|
|
}
|