diff --git a/test/gtest_observations.cpp b/test/gtest_observations.cpp index 6da3a598a16e74907933d7f5659f0fbf54b01764..fe10475eb943bd0c76e9e7e14092cd82d95a5135 100644 --- a/test/gtest_observations.cpp +++ b/test/gtest_observations.cpp @@ -101,7 +101,6 @@ TEST(ObservationsTest, data) Observations observations; observations.loadFromRinex(rnx_file.c_str(), t_start, t_end, dt, opt); - for (int ii = 0; ii < obs.n; ++ii) { // We do this check like this because both loading functions load the rinex file and then sort the observations @@ -116,13 +115,31 @@ TEST(ObservationsTest, HasSatellite) Observations observations; observations.loadFromRinex(rnx_file.c_str(), t_start, t_end, dt, opt); - for (int ii = 0; ii < obs.n; ++ii) { ASSERT_TRUE(observations.hasSatellite(obs.data[ii].sat)); } } +TEST(ObservationsTest, FindCommonObservations) +{ + loadRinex(); + + Observations observations1; + observations1.loadFromRinex(rnx_file.c_str(), t_start, t_end, dt, opt); + Observations observations2(observations1); + + Observations common1; + Observations common2; + + Observations::findCommonObservations(observations1, observations2, common1, common2); + + for (auto obs = common1.getObservations().begin(); obs != common1.getObservations().end(); ++obs) + { + ASSERT_TRUE(equalObservations(common1.getObservationBySat(obs->sat), common2.getObservationBySat(obs->sat))); + } +} + int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv);