Skip to content
Snippets Groups Projects
Commit a0b932ca authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Use proper float comparision

parent 58591230
No related branches found
No related tags found
1 merge request!1Basic CI/CD setup
Pipeline #86743 failed
...@@ -68,7 +68,7 @@ TEST_F(SpectralKurtosisTester, sk_withoutRFI) ...@@ -68,7 +68,7 @@ TEST_F(SpectralKurtosisTester, sk_withoutRFI)
std::size_t nch = 1; std::size_t nch = 1;
sk_computation(nch, window_size, samples, stat); sk_computation(nch, window_size, samples, stat);
float expected_rfi_fraction = 0; float expected_rfi_fraction = 0;
EXPECT_EQ(expected_rfi_fraction, stat.rfi_fraction); EXPECT_FLOAT_EQ(expected_rfi_fraction, stat.rfi_fraction);
} }
TEST_F(SpectralKurtosisTester, sk_withRFI) TEST_F(SpectralKurtosisTester, sk_withRFI)
...@@ -83,7 +83,7 @@ TEST_F(SpectralKurtosisTester, sk_withRFI) ...@@ -83,7 +83,7 @@ TEST_F(SpectralKurtosisTester, sk_withRFI)
std::size_t nch = 1; std::size_t nch = 1;
sk_computation(nch, window_size, samples, stat); sk_computation(nch, window_size, samples, stat);
float expected_rfi_fraction = (rfi_window_indices.size()/float(sample_size/window_size)) + 0.01; float expected_rfi_fraction = (rfi_window_indices.size()/float(sample_size/window_size)) + 0.01;
EXPECT_EQ(expected_rfi_fraction, stat.rfi_fraction); //To check: fails inspite of actual and expected values being same. EXPECT_FLOAT_EQ(expected_rfi_fraction, stat.rfi_fraction); //To check: fails inspite of actual and expected values being same.
} }
TEST_F(SpectralKurtosisTester, sk_replacement) TEST_F(SpectralKurtosisTester, sk_replacement)
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment