diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc index c22c6f595..5cfca59d5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc @@ -31,17 +31,33 @@ TEST(Serdes_Monitor_Pvt_Test, Simpletest) mon.ParseFromString(serialized_data); double read_latitude = mon.latitude(); EXPECT_NEAR(true_latitude, read_latitude, 0.000001); +} + +TEST(Serdes_Monitor_Pvt_Test, GalileoEphemerisSerdes) +{ auto eph = std::make_shared(); int true_tow = 12345; eph->tow = true_tow; Serdes_Galileo_Eph gal_serdes = Serdes_Galileo_Eph(); - serialized_data = gal_serdes.createProtobuffer(eph); + std::string serialized_data = gal_serdes.createProtobuffer(eph); gnss_sdr::GalileoEphemeris ephgal; ephgal.ParseFromString(serialized_data); + double true_delta_n = 0.33; + ephgal.set_delta_n(true_delta_n); + int read_tow = ephgal.tow(); EXPECT_EQ(true_tow, read_tow); + + double read_delta_n = ephgal.delta_n(); + EXPECT_NEAR(true_delta_n, read_delta_n, 0.000001); + + auto eph2 = gal_serdes.readProtobuffer(ephgal); + double read2_delta_n = eph2.delta_n; + int read2_tow = eph2.tow; + EXPECT_EQ(true_tow, read2_tow); + EXPECT_NEAR(true_delta_n, read2_delta_n, 0.000001); }