From 130de7acace2a02c098bda8d1e57008ead080eac Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Jun 2017 23:59:47 +0200 Subject: [PATCH] Avoid underscores in Test Cases and Test Names According to https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#why-should-not-test-case-names-and-test-names-contain-underscore --- .../system-tests/obs_gps_l1_system_test.cc | 30 +++++++++---------- src/tests/system-tests/position_test.cc | 28 ++++++++--------- src/tests/system-tests/ttff_gps_l1.cc | 12 ++++---- .../tracking/cpu_multicorrelator_test.cc | 2 +- .../tracking/gpu_multicorrelator_test.cc | 2 +- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/tests/system-tests/obs_gps_l1_system_test.cc b/src/tests/system-tests/obs_gps_l1_system_test.cc index 5a63924f3..4948e17b7 100644 --- a/src/tests/system-tests/obs_gps_l1_system_test.cc +++ b/src/tests/system-tests/obs_gps_l1_system_test.cc @@ -60,7 +60,7 @@ concurrent_queue global_gps_acq_assist_queue; concurrent_map global_gps_acq_assist_map; -class Obs_Gps_L1_System_Test: public ::testing::Test +class ObsGpsL1SystemTest: public ::testing::Test { public: std::string generator_binary; @@ -88,7 +88,7 @@ public: }; -bool Obs_Gps_L1_System_Test::check_valid_rinex_nav(std::string filename) +bool ObsGpsL1SystemTest::check_valid_rinex_nav(std::string filename) { bool res = false; res = gpstk::isRinexNavFile(filename); @@ -96,7 +96,7 @@ bool Obs_Gps_L1_System_Test::check_valid_rinex_nav(std::string filename) } -double Obs_Gps_L1_System_Test::compute_stdev(const std::vector & vec) +double ObsGpsL1SystemTest::compute_stdev(const std::vector & vec) { double sum__ = std::accumulate(vec.begin(), vec.end(), 0.0); double mean__ = sum__ / vec.size(); @@ -109,7 +109,7 @@ double Obs_Gps_L1_System_Test::compute_stdev(const std::vector & vec) } -bool Obs_Gps_L1_System_Test::check_valid_rinex_obs(std::string filename) +bool ObsGpsL1SystemTest::check_valid_rinex_obs(std::string filename) { bool res = false; res = gpstk::isRinexObsFile(filename); @@ -117,7 +117,7 @@ bool Obs_Gps_L1_System_Test::check_valid_rinex_obs(std::string filename) } -int Obs_Gps_L1_System_Test::configure_generator() +int ObsGpsL1SystemTest::configure_generator() { // Configure signal generator generator_binary = FLAGS_generator_binary; @@ -139,7 +139,7 @@ int Obs_Gps_L1_System_Test::configure_generator() } -int Obs_Gps_L1_System_Test::generate_signal() +int ObsGpsL1SystemTest::generate_signal() { pid_t wait_result; int child_status; @@ -164,7 +164,7 @@ int Obs_Gps_L1_System_Test::generate_signal() } -int Obs_Gps_L1_System_Test::configure_receiver() +int ObsGpsL1SystemTest::configure_receiver() { config = std::make_shared(); @@ -322,7 +322,7 @@ int Obs_Gps_L1_System_Test::configure_receiver() } -int Obs_Gps_L1_System_Test::run_receiver() +int ObsGpsL1SystemTest::run_receiver() { std::shared_ptr control_thread; control_thread = std::make_shared(config); @@ -353,14 +353,14 @@ int Obs_Gps_L1_System_Test::run_receiver() while (fgets(buffer, sizeof(buffer), fp) != NULL) { std::string aux = std::string(buffer); - Obs_Gps_L1_System_Test::generated_rinex_obs = aux.erase(aux.length() - 1, 1); + ObsGpsL1SystemTest::generated_rinex_obs = aux.erase(aux.length() - 1, 1); } pclose(fp); return 0; } -void Obs_Gps_L1_System_Test::check_results() +void ObsGpsL1SystemTest::check_results() { std::vector> > pseudorange_ref(33); std::vector> > carrierphase_ref(33); @@ -433,7 +433,7 @@ void Obs_Gps_L1_System_Test::check_results() try { - std::string arg2_gen = std::string("./") + Obs_Gps_L1_System_Test::generated_rinex_obs; + std::string arg2_gen = std::string("./") + ObsGpsL1SystemTest::generated_rinex_obs; gpstk::Rinex3ObsStream r_meas(arg2_gen); r_meas.exceptions(std::ios::failbit); gpstk::Rinex3ObsData r_meas_data; @@ -658,7 +658,7 @@ void Obs_Gps_L1_System_Test::check_results() } -TEST_F(Obs_Gps_L1_System_Test, Observables_system_test) +TEST_F(ObsGpsL1SystemTest, Observables_system_test) { std::cout << "Validating input RINEX nav file: " << FLAGS_rinex_nav_file << " ..." << std::endl; bool is_rinex_nav_valid = check_valid_rinex_nav(FLAGS_rinex_nav_file); @@ -685,9 +685,9 @@ TEST_F(Obs_Gps_L1_System_Test, Observables_system_test) // Run the receiver EXPECT_EQ( run_receiver(), 0) << "Problem executing the software-defined signal generator"; - std::cout << "Validating RINEX obs file obtained by GNSS-SDR: " << Obs_Gps_L1_System_Test::generated_rinex_obs << " ..." << std::endl; - is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + Obs_Gps_L1_System_Test::generated_rinex_obs); - EXPECT_EQ(true, is_gen_rinex_obs_valid) << "The RINEX observation file " << Obs_Gps_L1_System_Test::generated_rinex_obs << ", generated by GNSS-SDR, is not well formed."; + std::cout << "Validating RINEX obs file obtained by GNSS-SDR: " << ObsGpsL1SystemTest::generated_rinex_obs << " ..." << std::endl; + is_gen_rinex_obs_valid = check_valid_rinex_obs( "./" + ObsGpsL1SystemTest::generated_rinex_obs); + EXPECT_EQ(true, is_gen_rinex_obs_valid) << "The RINEX observation file " << ObsGpsL1SystemTest::generated_rinex_obs << ", generated by GNSS-SDR, is not well formed."; std::cout << "The file is valid." << std::endl; // Check results diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index abf9b971d..4c6a04970 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -51,7 +51,7 @@ DEFINE_string(config_file_ptest, std::string(""), "File containing the configura concurrent_queue global_gps_acq_assist_queue; concurrent_map global_gps_acq_assist_map; -class Static_Position_System_Test: public ::testing::Test +class StaticPositionSystemTest: public ::testing::Test { public: std::string generator_binary; @@ -92,7 +92,7 @@ private: -void Static_Position_System_Test::geodetic2Ecef(const double latitude, const double longitude, const double altitude, +void StaticPositionSystemTest::geodetic2Ecef(const double latitude, const double longitude, const double altitude, double* x, double* y, double* z) { const double a = 6378137.0; // WGS84 @@ -117,7 +117,7 @@ void Static_Position_System_Test::geodetic2Ecef(const double latitude, const dou } -void Static_Position_System_Test::geodetic2Enu(const double latitude, const double longitude, const double altitude, +void StaticPositionSystemTest::geodetic2Enu(const double latitude, const double longitude, const double altitude, double* east, double* north, double* up) { double x, y, z; @@ -160,7 +160,7 @@ void Static_Position_System_Test::geodetic2Enu(const double latitude, const doub } -double Static_Position_System_Test::compute_stdev_precision(const std::vector & vec) +double StaticPositionSystemTest::compute_stdev_precision(const std::vector & vec) { double sum__ = std::accumulate(vec.begin(), vec.end(), 0.0); double mean__ = sum__ / vec.size(); @@ -173,7 +173,7 @@ double Static_Position_System_Test::compute_stdev_precision(const std::vector & vec, const double ref) +double StaticPositionSystemTest::compute_stdev_accuracy(const std::vector & vec, const double ref) { const double mean__ = ref; double accum__ = 0.0; @@ -185,7 +185,7 @@ double Static_Position_System_Test::compute_stdev_accuracy(const std::vector control_thread; if(FLAGS_config_file_ptest.empty()) @@ -440,17 +440,17 @@ int Static_Position_System_Test::run_receiver() { std::string aux = std::string(buffer); EXPECT_EQ(aux.empty(), false); - Static_Position_System_Test::generated_kml_file = aux.erase(aux.length() - 1, 1); + StaticPositionSystemTest::generated_kml_file = aux.erase(aux.length() - 1, 1); } pclose(fp); - EXPECT_EQ(Static_Position_System_Test::generated_kml_file.empty(), false); + EXPECT_EQ(StaticPositionSystemTest::generated_kml_file.empty(), false); return 0; } -void Static_Position_System_Test::check_results() +void StaticPositionSystemTest::check_results() { - std::fstream myfile(Static_Position_System_Test::generated_kml_file, std::ios_base::in); + std::fstream myfile(StaticPositionSystemTest::generated_kml_file, std::ios_base::in); std::string line; std::vector pos_e; @@ -544,7 +544,7 @@ void Static_Position_System_Test::check_results() } -TEST_F(Static_Position_System_Test, Position_system_test) +TEST_F(StaticPositionSystemTest, Position_system_test) { if(FLAGS_config_file_ptest.empty()) { diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc index 37a21d9d2..c3dbc2598 100644 --- a/src/tests/system-tests/ttff_gps_l1.cc +++ b/src/tests/system-tests/ttff_gps_l1.cc @@ -75,7 +75,7 @@ typedef struct { } ttff_msgbuf; -class TTFF_GPS_L1_CA_Test: public ::testing::Test +class TfttGpsL1CATest: public ::testing::Test { public: void config_1(); @@ -124,7 +124,7 @@ public: }; -void TTFF_GPS_L1_CA_Test::config_1() +void TfttGpsL1CATest::config_1() { config = std::make_shared(); @@ -235,7 +235,7 @@ void TTFF_GPS_L1_CA_Test::config_1() } -void TTFF_GPS_L1_CA_Test::config_2() +void TfttGpsL1CATest::config_2() { if(FLAGS_config_file_ttff.empty()) { @@ -296,7 +296,7 @@ void receive_msg() } -void TTFF_GPS_L1_CA_Test::print_TTFF_report(const std::vector & ttff_v, std::shared_ptr config_) +void TfttGpsL1CATest::print_TTFF_report(const std::vector & ttff_v, std::shared_ptr config_) { std::ofstream ttff_report_file; std::string filename = "ttff_report"; @@ -455,7 +455,7 @@ void TTFF_GPS_L1_CA_Test::print_TTFF_report(const std::vector & ttff_v, } -TEST_F(TTFF_GPS_L1_CA_Test, ColdStart) +TEST_F(TfttGpsL1CATest, ColdStart) { unsigned int num_measurements = 0; @@ -540,7 +540,7 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart) } -TEST_F(TTFF_GPS_L1_CA_Test, HotStart) +TEST_F(TfttGpsL1CATest, HotStart) { unsigned int num_measurements = 0; TTFF_v.clear(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index 2c2dc4fcf..71f1605b1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -59,7 +59,7 @@ void run_correlator_cpu(cpu_multicorrelator* correlator, } } -TEST(CPUMulticorrelatorTest, MeasureExecutionTime) +TEST(CpuMulticorrelatorTest, MeasureExecutionTime) { struct timeval tv; int max_threads=FLAGS_cpu_multicorrelator_max_threads_test; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc index 17fcdb68f..08ff7e02b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc @@ -62,7 +62,7 @@ void run_correlator_gpu(cuda_multicorrelator* correlator, } } -TEST(GPU_multicorrelator_test, MeasureExecutionTime) +TEST(GpuMulticorrelatorTest, MeasureExecutionTime) { struct timeval tv; int max_threads=FLAGS_gpu_multicorrelator_max_threads_test;