Skip to content

Commit

Permalink
Merge pull request #11291 from jjimenezshaw/fix-coverity-tests
Browse files Browse the repository at this point in the history
fix some coverity tests
  • Loading branch information
rouault authored Nov 17, 2024
2 parents 9b5cc40 + 6c4153f commit d9614a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions alg/gdal_interpolateatpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ bool GDALInterpolateAtPointImpl(GDALRasterBand *pBand,
else
{
const gdal::Vector2i d = inLoc.cast<int>();
T dfOut{};
if (!GDALInterpExtractValuesWindow(pBand, cache, d, {1, 1}, &dfOut) ||
(bGotNoDataValue && areEqualReal(dfNoDataValue, dfOut)))
T adfOut[1] = {};
if (!GDALInterpExtractValuesWindow(pBand, cache, d, {1, 1}, adfOut) ||
(bGotNoDataValue && areEqualReal(dfNoDataValue, adfOut[0])))
{
return FALSE;
}

out = dfOut;
out = adfOut[0];

return TRUE;
}
Expand Down
4 changes: 2 additions & 2 deletions autotest/cpp/test_gdal_vectorx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ TEST_F(test_vectorx, array)

TEST_F(test_vectorx, fill)
{
const auto a = gdal::Vector3d().fill(42.0);
const gdal::Vector3d a = gdal::Vector3d().fill(42.0);
EXPECT_EQ(3, a.size());
EXPECT_EQ(42.0, a[0]);
EXPECT_EQ(42.0, a[1]);
Expand All @@ -128,7 +128,7 @@ TEST_F(test_vectorx, fill)

TEST_F(test_vectorx, fill_nan)
{
const auto a =
const gdal::Vector3d a =
gdal::Vector3d().fill(std::numeric_limits<double>::quiet_NaN());
EXPECT_EQ(3, a.size());
EXPECT_TRUE(std::isnan(a[0]));
Expand Down

0 comments on commit d9614a0

Please sign in to comment.