Skip to content

Commit

Permalink
fix some coverity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjimenezshaw committed Nov 17, 2024
1 parent 9b5cc40 commit 6c4153f
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 6c4153f

Please sign in to comment.