mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-06-13 16:56:52 +00:00
Code cleaning
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@261 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
994de02032
commit
fb0b2b8b33
|
@ -35,14 +35,11 @@
|
|||
#include "file_output_filter.h"
|
||||
#include "in_memory_configuration.h"
|
||||
|
||||
TEST(FileOutputFilter, Instantiate) {
|
||||
|
||||
TEST(FileOutputFilter, Instantiate)
|
||||
{
|
||||
InMemoryConfiguration* config = new InMemoryConfiguration();
|
||||
|
||||
config->set_property("Test.filename", "../data/output.dat");
|
||||
config->set_property("Test.item_type", "float");
|
||||
|
||||
FileOutputFilter *output_filter = new FileOutputFilter(config, "Test", 1, 0);
|
||||
|
||||
delete output_filter;
|
||||
}
|
||||
|
|
|
@ -30,21 +30,17 @@
|
|||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <gr_block.h>
|
||||
#include <gr_msg_queue.h>
|
||||
#include <gr_top_block.h>
|
||||
#include <gr_null_sink.h>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "file_signal_source.h"
|
||||
#include "in_memory_configuration.h"
|
||||
|
||||
TEST(FileSignalSource, Instantiate) {
|
||||
|
||||
TEST(FileSignalSource, Instantiate)
|
||||
{
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
InMemoryConfiguration* config = new InMemoryConfiguration();
|
||||
|
||||
config->set_property("Test.samples", "0");
|
||||
|
@ -62,10 +58,9 @@ TEST(FileSignalSource, Instantiate) {
|
|||
delete signal_source;
|
||||
}
|
||||
|
||||
TEST(FileSignalSource, InstantiateFileNotExists) {
|
||||
|
||||
TEST(FileSignalSource, InstantiateFileNotExists)
|
||||
{
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
InMemoryConfiguration* config = new InMemoryConfiguration();
|
||||
|
||||
config->set_property("Test.samples", "0");
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <gnuradio/gr_sig_source_c.h>
|
||||
#include <gnuradio/gr_msg_queue.h>
|
||||
#include <gnuradio/gr_null_sink.h>
|
||||
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "in_memory_configuration.h"
|
||||
|
@ -45,16 +44,19 @@
|
|||
|
||||
DEFINE_string(filter_test_output_filename, "../src/tests/data/fir_filter_test_output.dat", "Dump filename");
|
||||
|
||||
class Fir_Filter_Test: public ::testing::Test {
|
||||
class Fir_Filter_Test: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
Fir_Filter_Test() {
|
||||
Fir_Filter_Test()
|
||||
{
|
||||
queue = gr_make_msg_queue(0);
|
||||
top_block = gr_make_top_block("Fir filter test");
|
||||
config = new InMemoryConfiguration();
|
||||
item_size = sizeof(gr_complex);
|
||||
|
||||
}
|
||||
~Fir_Filter_Test() {
|
||||
~Fir_Filter_Test()
|
||||
{
|
||||
delete config;
|
||||
}
|
||||
void init();
|
||||
|
@ -62,11 +64,10 @@ protected:
|
|||
gr_top_block_sptr top_block;
|
||||
InMemoryConfiguration* config;
|
||||
size_t item_size;
|
||||
|
||||
};
|
||||
|
||||
void Fir_Filter_Test::init(){
|
||||
|
||||
void Fir_Filter_Test::init()
|
||||
{
|
||||
config->set_property("InputFilter.number_of_taps", "4");
|
||||
config->set_property("InputFilter.number_of_bands", "2");
|
||||
|
||||
|
@ -85,17 +86,14 @@ void Fir_Filter_Test::init(){
|
|||
|
||||
config->set_property("InputFilter.filter_type", "bandpass");
|
||||
config->set_property("InputFilter.grid_density", "16");
|
||||
|
||||
//config->set_property("InputFilter.dump", "true");
|
||||
|
||||
}
|
||||
|
||||
|
||||
TEST_F(Fir_Filter_Test, Instantiate)
|
||||
{
|
||||
init();
|
||||
|
||||
FirFilter *filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
|
||||
delete filter;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <gnuradio/gr_msg_queue.h>
|
||||
#include <gnuradio/gr_null_sink.h>
|
||||
#include <gnuradio/gr_skiphead.h>
|
||||
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "in_memory_configuration.h"
|
||||
|
@ -50,9 +49,11 @@
|
|||
|
||||
#include "galileo_e1_dll_pll_veml_tracking.h"
|
||||
|
||||
class GalileoE1DllPllVemlTrackingInternalTest: public ::testing::Test {
|
||||
class GalileoE1DllPllVemlTrackingInternalTest: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
GalileoE1DllPllVemlTrackingInternalTest() {
|
||||
GalileoE1DllPllVemlTrackingInternalTest()
|
||||
{
|
||||
queue = gr_make_msg_queue(0);
|
||||
top_block = gr_make_top_block("Tracking test");
|
||||
factory = new GNSSBlockFactory();
|
||||
|
@ -62,7 +63,8 @@ protected:
|
|||
message = 0;
|
||||
}
|
||||
|
||||
~GalileoE1DllPllVemlTrackingInternalTest() {
|
||||
~GalileoE1DllPllVemlTrackingInternalTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
|
@ -81,8 +83,9 @@ protected:
|
|||
boost::thread ch_thread;
|
||||
};
|
||||
|
||||
void GalileoE1DllPllVemlTrackingInternalTest::init(){
|
||||
|
||||
void GalileoE1DllPllVemlTrackingInternalTest::init()
|
||||
{
|
||||
gnss_synchro.Channel_ID=0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1B";
|
||||
|
@ -106,12 +109,9 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, Instantiate)
|
|||
{
|
||||
|
||||
init();
|
||||
|
||||
GalileoE1DllPllVemlTracking *tracking = new GalileoE1DllPllVemlTracking(config, "Tracking", 1, 1, queue);
|
||||
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
|
||||
|
||||
delete tracking;
|
||||
|
||||
}
|
||||
|
||||
//TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
|
||||
|
@ -180,7 +180,6 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
|||
tracking->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
tracking->connect(top_block);
|
||||
}) << "Failure connecting tracking to the top_block."<< std::endl;
|
||||
|
@ -215,5 +214,4 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
|||
std::cout << "Tracked " << num_samples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
|
||||
delete tracking;
|
||||
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <gnuradio/gr_sig_source_c.h>
|
||||
#include <gnuradio/gr_msg_queue.h>
|
||||
#include <gnuradio/gr_null_sink.h>
|
||||
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "in_memory_configuration.h"
|
||||
|
@ -50,9 +49,11 @@
|
|||
|
||||
#include "galileo_e1_pcps_ambiguous_acquisition.h"
|
||||
|
||||
class GalileoE1PcpsAmbiguousAcquisitionTest: public ::testing::Test {
|
||||
class GalileoE1PcpsAmbiguousAcquisitionTest: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
GalileoE1PcpsAmbiguousAcquisitionTest() {
|
||||
GalileoE1PcpsAmbiguousAcquisitionTest()
|
||||
{
|
||||
queue = gr_make_msg_queue(0);
|
||||
top_block = gr_make_top_block("Acquisition test");
|
||||
factory = new GNSSBlockFactory();
|
||||
|
@ -62,7 +63,8 @@ protected:
|
|||
message = 0;
|
||||
}
|
||||
|
||||
~GalileoE1PcpsAmbiguousAcquisitionTest() {
|
||||
~GalileoE1PcpsAmbiguousAcquisitionTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
|
@ -84,8 +86,8 @@ protected:
|
|||
boost::thread ch_thread;
|
||||
};
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionTest::init(){
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionTest::init()
|
||||
{
|
||||
gnss_synchro.Channel_ID=0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
|
@ -129,13 +131,9 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::stop_queue()
|
|||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate)
|
||||
{
|
||||
|
||||
init();
|
||||
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
|
||||
delete acquisition;
|
||||
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
|
@ -245,5 +243,4 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
|||
EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips";
|
||||
|
||||
delete acquisition;
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
#include "gnss_block_factory.h"
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("SignalSource.implementation", "File_Signal_Source");
|
||||
|
@ -65,7 +66,9 @@ TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource) {
|
|||
delete signal_source;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateUHDSignalSource) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateUHDSignalSource)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("SignalSource.implementation", "UHD_Signal_Source");
|
||||
|
@ -82,11 +85,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateUHDSignalSource) {
|
|||
delete signal_source;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("SignalSource.implementation", "Pepito");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -99,11 +102,10 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource) {
|
|||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("SignalConditioner.implementation", "Signal_Conditioner");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -117,9 +119,10 @@ TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner) {
|
|||
delete signal_conditioner;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter) {
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
configuration->set_property("InputFilter.implementation", "Fir_Filter");
|
||||
|
@ -154,9 +157,9 @@ TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter) {
|
|||
delete input_filter;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
configuration->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
|
||||
|
@ -194,11 +197,10 @@ TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter) {
|
|||
delete input_filter;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Resampler.implementation", "Direct_Resampler");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -212,17 +214,15 @@ TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler) {
|
|||
delete resampler;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
AcquisitionInterface *acquisition = (AcquisitionInterface*)factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_PCPS_Acquisition", acquisition->implementation().c_str());
|
||||
|
||||
|
@ -231,17 +231,16 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition) {
|
|||
delete acquisition;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
AcquisitionInterface *acquisition = (AcquisitionInterface*)factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
||||
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
|
||||
|
||||
|
@ -249,17 +248,17 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition) {
|
|||
delete factory;
|
||||
delete acquisition;
|
||||
}
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllFllPllTracking) {
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllFllPllTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_FLL_PLL_Tracking");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_FLL_PLL_Tracking", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_DLL_FLL_PLL_Tracking", tracking->implementation().c_str());
|
||||
|
||||
|
@ -268,17 +267,16 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllFllPllTracking) {
|
|||
delete tracking;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_Tracking", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_DLL_PLL_Tracking", tracking->implementation().c_str());
|
||||
|
||||
|
@ -287,17 +285,16 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking) {
|
|||
delete tracking;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Tracking.implementation", "GPS_L1_CA_TCP_CONNECTOR_Tracking");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_TCP_CONNECTOR_Tracking", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_TCP_CONNECTOR_Tracking", tracking->implementation().c_str());
|
||||
|
||||
|
@ -306,17 +303,16 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking) {
|
|||
delete tracking;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
|
||||
|
||||
|
@ -325,17 +321,16 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking) {
|
|||
delete tracking;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
TelemetryDecoderInterface *telemetry_decoder = (TelemetryDecoderInterface*)factory->GetBlock(configuration, "TelemetryDecoder", "GPS_L1_CA_Telemetry_Decoder", 1, 1, queue);
|
||||
|
||||
|
||||
EXPECT_STREQ("TelemetryDecoder", telemetry_decoder->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_Telemetry_Decoder", telemetry_decoder->implementation().c_str());
|
||||
|
||||
|
@ -344,7 +339,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder) {
|
|||
delete telemetry_decoder;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateChannels) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateChannels)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Channels.count", "2");
|
||||
|
@ -368,17 +364,16 @@ TEST(GNSS_Block_Factory_Test, InstantiateChannels) {
|
|||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
for(unsigned int i=0 ; i<channels->size() ; i++)
|
||||
delete channels->at(i);
|
||||
for(unsigned int i=0 ; i<channels->size() ; i++) delete channels->at(i);
|
||||
channels->clear();
|
||||
delete channels;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateObservables) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateObservables)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Observables.implementation", "Pass_Through");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -392,11 +387,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateObservables) {
|
|||
delete observables;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Observables.implementation", "GPS_L1_CA_Observables");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -410,11 +405,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables) {
|
|||
delete observables;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongObservables) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongObservables)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("Observables.implementation", "Pepito");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -427,11 +422,10 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongObservables) {
|
|||
delete observables;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiatePvt) {
|
||||
TEST(GNSS_Block_Factory_Test, InstantiatePvt)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("PVT.implementation", "Pass_Through");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -445,11 +439,11 @@ TEST(GNSS_Block_Factory_Test, InstantiatePvt) {
|
|||
delete pvt;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("PVT.implementation", "GPS_L1_CA_PVT");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -463,11 +457,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt) {
|
|||
delete pvt;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("PVT.implementation", "Pepito");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -480,11 +474,12 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt) {
|
|||
delete pvt;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateNullSinkOutputFilter) {
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateNullSinkOutputFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("OutputFilter.implementation", "Null_Sink_Output_Filter");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -498,11 +493,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateNullSinkOutputFilter) {
|
|||
delete output_filter;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFileOutputFilter) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFileOutputFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("OutputFilter.implementation", "File_Output_Filter");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
@ -516,11 +511,11 @@ TEST(GNSS_Block_Factory_Test, InstantiateFileOutputFilter) {
|
|||
delete output_filter;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongOutputFilter) {
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongOutputFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
configuration->set_property("OutputFilter.implementation", "Pepito");
|
||||
|
||||
gr_msg_queue_sptr queue = gr_make_msg_queue(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
|
|
|
@ -40,18 +40,19 @@
|
|||
#include <gnuradio/gr_sig_source_c.h>
|
||||
#include <gnuradio/gr_msg_queue.h>
|
||||
#include <gnuradio/gr_null_sink.h>
|
||||
|
||||
#include "gnss_block_factory.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "in_memory_configuration.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
#include "gps_l1_ca_pcps_acquisition.h"
|
||||
|
||||
class GpsL1CaPcpsAcquisitionTest: public ::testing::Test {
|
||||
|
||||
class GpsL1CaPcpsAcquisitionTest: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
GpsL1CaPcpsAcquisitionTest() {
|
||||
GpsL1CaPcpsAcquisitionTest()
|
||||
{
|
||||
queue = gr_make_msg_queue(0);
|
||||
top_block = gr_make_top_block("Acquisition test");
|
||||
factory = new GNSSBlockFactory();
|
||||
|
@ -61,7 +62,8 @@ protected:
|
|||
message = 0;
|
||||
}
|
||||
|
||||
~GpsL1CaPcpsAcquisitionTest() {
|
||||
~GpsL1CaPcpsAcquisitionTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
|
@ -83,8 +85,9 @@ protected:
|
|||
boost::thread ch_thread;
|
||||
};
|
||||
|
||||
void GpsL1CaPcpsAcquisitionTest::init(){
|
||||
|
||||
void GpsL1CaPcpsAcquisitionTest::init()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'G';
|
||||
std::string signal = "1C";
|
||||
|
@ -101,9 +104,9 @@ void GpsL1CaPcpsAcquisitionTest::init(){
|
|||
config->set_property("Acquisition.doppler_max", "7200");
|
||||
config->set_property("Acquisition.doppler_step", "600");
|
||||
config->set_property("Acquisition.repeat_satellite", "false");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionTest::start_queue()
|
||||
{
|
||||
ch_thread = boost::thread(&GpsL1CaPcpsAcquisitionTest::wait_message, this);
|
||||
|
@ -119,6 +122,8 @@ void GpsL1CaPcpsAcquisitionTest::wait_message()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionTest::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
|
@ -128,13 +133,9 @@ void GpsL1CaPcpsAcquisitionTest::stop_queue()
|
|||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, Instantiate)
|
||||
{
|
||||
|
||||
init();
|
||||
|
||||
GpsL1CaPcpsAcquisition *acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
|
||||
delete acquisition;
|
||||
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
|
|
Loading…
Reference in New Issue
Block a user