From b1f880c19a7eaa41c721460f2fcb7cd8413e0c10 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Jul 2017 12:42:22 +0200 Subject: [PATCH 1/2] Fix test --- src/tests/unit-tests/control-plane/gnss_block_factory_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc index ce82fbbde..d13902716 100644 --- a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc @@ -333,7 +333,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPvt) std::shared_ptr pvt_ = factory->GetPVT(configuration); std::shared_ptr pvt = std::dynamic_pointer_cast(pvt_); EXPECT_STREQ("PVT", pvt->role().c_str()); - EXPECT_STREQ("Hybrid_PVT", pvt->implementation().c_str()); + EXPECT_STREQ("RTKLIB_PVT", pvt->implementation().c_str()); } @@ -346,4 +346,3 @@ TEST(GNSSBlockFactoryTest, InstantiateWrongPvt) std::shared_ptr pvt = std::dynamic_pointer_cast(pvt_); EXPECT_EQ(nullptr, pvt); } - From e7149acf6ec50f49d5c5ee0a3924b9e421b21551 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Jul 2017 12:43:25 +0200 Subject: [PATCH 2/2] Better use of Test Case name --- .../arithmetic/code_generation_test.cc | 32 +++---------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index d7369f643..f18f65aa6 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -37,7 +37,7 @@ -TEST(CodeGenGPSL1Test, CodeGeneration) +TEST(CodeGenerationTest, CodeGenGPSL1Test) { std::complex* _dest = new std::complex[1023]; signed int _prn = 1; @@ -58,7 +58,7 @@ TEST(CodeGenGPSL1Test, CodeGeneration) long long int end = tv.tv_sec * 1000000 + tv.tv_usec; ASSERT_LE(0, end - begin); std::cout << "Generation completed in " << (end - begin) << " microseconds" << std::endl; - + /* std::complex* _dest2 = new std::complex[1023];gettimeofday(&tv, NULL); @@ -83,7 +83,7 @@ TEST(CodeGenGPSL1Test, CodeGeneration) -TEST(CodeGenGPSL1SampledTest, CodeGeneration) +TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) { signed int _prn = 1; unsigned int _chip_shift = 4; @@ -132,7 +132,7 @@ TEST(CodeGenGPSL1SampledTest, CodeGeneration) } -TEST(ComplexCarrierTest, CodeGeneration) +TEST(CodeGenerationTest, ComplexConjugateTest) { double _fs = 8000000; double _f = 4000; @@ -154,29 +154,7 @@ TEST(ComplexCarrierTest, CodeGeneration) gettimeofday(&tv, NULL); long long int end = tv.tv_sec * 1000000 + tv.tv_usec; - delete[] _dest; + delete[] _dest; ASSERT_LE(0, end - begin); std::cout << "Carrier generation completed in " << (end - begin) << " microseconds" << std::endl; - - /* std::complex* _dest2 = new std::complex[_samplesPerCode]; - gettimeofday(&tv, NULL); - long long int begin2 = tv.tv_sec * 1000000 + tv.tv_usec; - - for(int i = 0; i < iterations; i++) - { - complex_exp_gen_conj2( _dest2, _f, _fs, _samplesPerCode); - } - - gettimeofday(&tv, NULL); - long long int end2 = tv.tv_sec * 1000000 + tv.tv_usec; - std::cout << "Carrier generation completed in " << (end2 - begin2) << " microseconds (New)" << std::endl; - - for (int j=0; j<_samplesPerCode;j++) - { - if(std::abs(_dest[j] - _dest2[j]) > 0.1) std::cout << "Error!" << std::endl; - } - - std::cout << _dest[10] << "and " << _dest2[10] << std::endl; - delete[] _dest2;*/ - }