diff --git a/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx b/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx index 2f8bcbc965220fe31658083826f0e427117cfa71..b61998fdc61d25da5e99af841ace27c1a5afaddb 100644 --- a/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx +++ b/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx @@ -54,7 +54,7 @@ int otbAmplitudeFunctorTest(int argc, char * argv[]) funct.SetChannelList(channels); output = funct.operator ()(vectorPixel); result = vcl_sqrt(vectorPixel[i] * vectorPixel[i] + vectorPixel[j] * vectorPixel[j]); - if( abs(result-output[0]) > 0.0000001) + if( abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test VectorPixelType failed for channels " << i<< " and " << j << " !" << std::endl; @@ -78,7 +78,7 @@ int otbAmplitudeFunctorTest(int argc, char * argv[]) funct.SetChannelList(channels); output = funct.operator ()(rgbPixel); result = vcl_sqrt(rgbPixel[i] * rgbPixel[i] + rgbPixel[j] * rgbPixel[j]); - if( abs(result-output[0]) > 0.0000001) + if( abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test RGBPixelType failed for channels " << i<< " and " << j << " !" << std::endl; @@ -107,7 +107,7 @@ int otbAmplitudeFunctorTest(int argc, char * argv[]) funct.SetChannelList(channels); output = funct.operator ()(rgbaPixel); result = vcl_sqrt(rgbaPixel[i] * rgbaPixel[i] + rgbaPixel[j] * rgbaPixel[j]); - if( abs(result-output[0]) > 0.0000001) + if( abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test RGBAPixelType failed for channels " << i<< " and " << j << " !" << std::endl; diff --git a/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx b/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx index 57cbba8bf4a5ba9878238a7c9827a3dad8c05be5..5626436f603084fcf74e0829cc8e4dddb446e5ed 100644 --- a/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx +++ b/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx @@ -54,7 +54,7 @@ int ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest( int argc, char* numberOfPixelsInMask *= imageReader->GetOutput()->GetLargestPossibleRegion().GetSize()[i]; numberOfDirections *= 3; } - numberOfDirections = vcl_floor( 0.5 * numberOfDirections ); + numberOfDirections = static_cast<unsigned int>( vcl_floor( 0.5 * static_cast<double>(numberOfDirections) ) ); unsigned int numberOfBins = 100; try