2013-02-17 09:54:41 +00:00
|
|
|
/*!
|
|
|
|
* \file gnss_flowgraph_test.cc
|
|
|
|
* \brief This file implements tests for a flowgraph
|
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
* Carles Fernandez-Prades, 2012. cfernandez(at)cttc.es
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2014-03-23 09:45:03 +00:00
|
|
|
* Copyright (C) 2010-2014 (see AUTHORS file for a list of contributors)
|
2013-02-17 09:54:41 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* at your option) any later version.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2013-02-17 09:54:41 +00:00
|
|
|
* -------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
2013-07-04 13:47:40 +00:00
|
|
|
#include <gnuradio/msg_queue.h>
|
2011-10-01 18:45:20 +00:00
|
|
|
#include "gnss_flowgraph.h"
|
|
|
|
#include "gnss_block_interface.h"
|
|
|
|
#include "in_memory_configuration.h"
|
|
|
|
#include "file_configuration.h"
|
|
|
|
#include "channel.h"
|
|
|
|
#include "acquisition_interface.h"
|
2012-01-23 00:52:05 +00:00
|
|
|
#include "tracking_interface.h"
|
|
|
|
#include "channel_interface.h"
|
|
|
|
#include "null_sink_output_filter.h"
|
|
|
|
#include "pass_through.h"
|
|
|
|
#include "file_signal_source.h"
|
2011-10-01 18:45:20 +00:00
|
|
|
|
|
|
|
|
2012-01-23 00:52:05 +00:00
|
|
|
TEST(GNSSFlowgraph, InstantiateConnectStartStop)
|
|
|
|
{
|
|
|
|
InMemoryConfiguration* config = new InMemoryConfiguration();
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
config->set_property("SignalSource.sampling_frequency", "4000000");
|
2012-01-23 00:52:05 +00:00
|
|
|
config->set_property("SignalSource.implementation", "File_Signal_Source");
|
2013-02-17 09:54:41 +00:00
|
|
|
config->set_property("SignalSource.item_type", "gr_complex");
|
2014-03-23 09:45:03 +00:00
|
|
|
std::string path = std::string(TEST_PATH);
|
|
|
|
std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat";
|
|
|
|
config->set_property("SignalSource.filename", filename);
|
2012-01-23 00:52:05 +00:00
|
|
|
config->set_property("SignalConditioner.implementation", "Pass_Through");
|
|
|
|
config->set_property("Channels.count", "2");
|
|
|
|
config->set_property("Channels.acquisition.implementation", "Pass_Through");
|
|
|
|
config->set_property("Channels.tracking.implementation", "Pass_Through");
|
|
|
|
config->set_property("Channels.observables.implementation", "Pass_Through");
|
2013-02-17 09:54:41 +00:00
|
|
|
config->set_property("Observables.implementation", "GPS_L1_CA_Observables");
|
2012-01-23 00:52:05 +00:00
|
|
|
config->set_property("PVT.implementation", "GPS_L1_CA_PVT");
|
2013-02-17 09:54:41 +00:00
|
|
|
config->set_property("OutputFilter.implementation", "Null_Sink_Output_Filter");
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2013-07-04 13:47:40 +00:00
|
|
|
GNSSFlowgraph* flowgraph = new GNSSFlowgraph(config, gr::msg_queue::make(0));
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("File_Signal_Source", flowgraph->signal_source()->implementation().c_str());
|
2012-01-23 00:52:05 +00:00
|
|
|
EXPECT_STREQ("Pass_Through", flowgraph->signal_conditioner()->implementation().c_str());
|
|
|
|
EXPECT_STREQ("Channel", flowgraph->channel(0)->implementation().c_str());
|
|
|
|
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(0))->acquisition()->implementation().c_str());
|
|
|
|
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(0))->tracking()->implementation().c_str());
|
|
|
|
EXPECT_STREQ("Channel", flowgraph->channel(1)->implementation().c_str());
|
|
|
|
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(1))->acquisition()->implementation().c_str());
|
|
|
|
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(1))->tracking()->implementation().c_str());
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("GPS_L1_CA_Observables", flowgraph->observables()->implementation().c_str());
|
2012-01-23 00:52:05 +00:00
|
|
|
EXPECT_STREQ("GPS_L1_CA_PVT", flowgraph->pvt()->implementation().c_str());
|
2013-02-17 09:54:41 +00:00
|
|
|
EXPECT_STREQ("Null_Sink_Output_Filter", flowgraph->output_filter()->implementation().c_str());
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2012-01-23 00:52:05 +00:00
|
|
|
EXPECT_NO_THROW(flowgraph->connect());
|
|
|
|
EXPECT_TRUE(flowgraph->connected());
|
|
|
|
EXPECT_NO_THROW(flowgraph->start());
|
|
|
|
EXPECT_TRUE(flowgraph->running());
|
|
|
|
flowgraph->stop();
|
|
|
|
EXPECT_FALSE(flowgraph->running());
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2012-01-23 00:52:05 +00:00
|
|
|
delete flowgraph;
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|