Skip to content
Snippets Groups Projects
Commit c45755f7 authored by Pep Martí Saumell's avatar Pep Martí Saumell
Browse files

[test] added get observations by idx and sat

parent 486f3878
No related branches found
No related tags found
3 merge requests!20new tag,!19new tag,!6Resolve "observation_tests"
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
...@@ -39,10 +39,9 @@ TEST(ObservationsTest, AddClearObservation) ...@@ -39,10 +39,9 @@ TEST(ObservationsTest, AddClearObservation)
ASSERT_TRUE(obs.n == observations.getObservations().size()); ASSERT_TRUE(obs.n == observations.getObservations().size());
//Testing clear // Testing clear
observations.clearObservations(); observations.clearObservations();
ASSERT_TRUE(0 == observations.getObservations().size()); ASSERT_TRUE(0 == observations.getObservations().size());
} }
TEST(ObservationsTest, LoadFromRinex) TEST(ObservationsTest, LoadFromRinex)
...@@ -67,6 +66,38 @@ TEST(ObservationsTest, LoadFromRinex) ...@@ -67,6 +66,38 @@ TEST(ObservationsTest, LoadFromRinex)
free(obs.data); free(obs.data);
} }
TEST(ObservationsTest, GetObservationBySat)
{
loadRinex();
Observations observations;
observations.loadFromRinex(rnx_file.c_str(), t_start, t_end, dt, opt);
for (int ii = 0; ii < obs.n; ++ii)
{
ASSERT_TRUE(equalObservations(obs.data[ii], observations.getObservationBySat(obs.data[ii].sat)));
}
}
TEST(ObservationsTest, GetObservationByIdx)
{
loadRinex();
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
ASSERT_TRUE(equalObservations(obs.data[ii], observations.getObservationByIdx(ii)));
}
}
TEST()
{
}
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment