1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-18 07:44:57 +00:00

some test fixes

This commit is contained in:
Carles Fernandez 2016-05-01 12:39:40 +02:00
parent c14fed8b64
commit ad16c5ab35
3 changed files with 13 additions and 7 deletions

View File

@ -335,7 +335,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), g
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
{ {
d_rtcm_printer->Print_Rtcm_MT1002(gps_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map); d_rtcm_printer->Print_Rtcm_MSM(4, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_pseudoranges_map, 1234, 0, 0, 0, 0, 0);
} }
} }
if((d_sample_counter % 5000) == 0) if((d_sample_counter % 5000) == 0)
@ -356,7 +356,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), g
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
{ {
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
d_rtcm_printer->Print_Rtcm_MSM(1, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_pseudoranges_map, 1234, 0, 0, 0, 0, 0); d_rtcm_printer->Print_Rtcm_MSM(4, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_pseudoranges_map, 1234, 0, 0, 0, 0, 0);
} }
b_rtcm_writing_started = true; b_rtcm_writing_started = true;
} }

View File

@ -158,8 +158,14 @@ TEST(Rtcm_Test, Bin_to_int)
TEST(Rtcm_Test, Bin_to_binary_data) TEST(Rtcm_Test, Bin_to_binary_data)
{ {
auto rtcm = std::make_shared<Rtcm>(); auto rtcm = std::make_shared<Rtcm>();
std::string bin_str("01011010"); std::string bin_str("11011010");
std::string data_str = rtcm->bin_to_binary_data(bin_str); std::string data_str = rtcm->bin_to_binary_data(bin_str);
std::string test_binary = data_str.substr(0,1);
std::string test_bin = rtcm->binary_data_to_bin(test_binary);
std::string test_hex = rtcm->bin_to_hex(test_bin);
EXPECT_EQ(0, test_hex.compare("D"));
std::string recovered_str = rtcm->binary_data_to_bin(data_str); std::string recovered_str = rtcm->binary_data_to_bin(data_str);
EXPECT_EQ(0, recovered_str.compare(bin_str)); EXPECT_EQ(0, recovered_str.compare(bin_str));
} }
@ -266,7 +272,7 @@ TEST(Rtcm_Test, MT1019)
EXPECT_DOUBLE_EQ(4, gps_eph_read.d_IODC); EXPECT_DOUBLE_EQ(4, gps_eph_read.d_IODC);
EXPECT_DOUBLE_EQ( 2.0 * E_LSB, gps_eph_read.d_e_eccentricity); EXPECT_DOUBLE_EQ( 2.0 * E_LSB, gps_eph_read.d_e_eccentricity);
EXPECT_EQ(expected_true, gps_eph_read.b_fit_interval_flag); EXPECT_EQ(expected_true, gps_eph_read.b_fit_interval_flag);
EXPECT_EQ(1, rtcm->read_MT1019("FFFFFFFFFFF", gps_eph_read)); EXPECT_EQ(1, rtcm->read_MT1019(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gps_eph_read));
} }
@ -306,7 +312,7 @@ TEST(Rtcm_Test, MT1045)
EXPECT_EQ(expected_true, gal_eph_read.E5a_DVS); EXPECT_EQ(expected_true, gal_eph_read.E5a_DVS);
EXPECT_DOUBLE_EQ( 53.0 * OMEGA_dot_3_LSB, gal_eph_read.OMEGA_dot_3); EXPECT_DOUBLE_EQ( 53.0 * OMEGA_dot_3_LSB, gal_eph_read.OMEGA_dot_3);
EXPECT_EQ(5, gal_eph_read.i_satellite_PRN); EXPECT_EQ(5, gal_eph_read.i_satellite_PRN);
EXPECT_EQ(1, rtcm->read_MT1045("FFFFFFFFFFF", gal_eph_read)); EXPECT_EQ(1, rtcm->read_MT1045(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gal_eph_read));
} }
@ -571,7 +577,7 @@ TEST(Rtcm_Test, InstantiateServer)
EXPECT_EQ(expected1, rtcm->bin_to_uint("00101010")); EXPECT_EQ(expected1, rtcm->bin_to_uint("00101010"));
rtcm->run_server(); rtcm->run_server();
std::string test4_bin = rtcm->hex_to_bin(test3); std::string test4_bin = rtcm->hex_to_bin(test3);
std::string s("Testing"); std::string s = rtcm->bin_to_binary_data(test4_bin);
rtcm->send_message(s); rtcm->send_message(s);
rtcm->stop_server(); rtcm->stop_server();
EXPECT_EQ(0, test4_bin.compare("11111111")); EXPECT_EQ(0, test4_bin.compare("11111111"));

View File

@ -84,7 +84,7 @@ void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
} }
catch(boost::bad_any_cast& e) catch(boost::bad_any_cast& e)
{ {
LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n"; LOG(WARNING) << "msg_handler_telemetry Bad any cast!";
rx_message = 0; rx_message = 0;
} }
} }