Skip to content

Commit

Permalink
Fix MSVC compiler warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lindstro committed Jan 11, 2025
1 parent 7de37c9 commit 25e9d74
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/array/array/testArray1ViewsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_view_when_setEntryWithBrackets_then_o
{
ZFP_ARRAY_TYPE::view v(&arr, offset, viewLen);
size_t i = 1;
SCALAR val = 3.14;
SCALAR val = SCALAR(3.14);

EXPECT_NE(val, arr(offset + i));
v[i] = val;
Expand Down Expand Up @@ -98,7 +98,7 @@ TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_view_when_setEntryWithParens_then_ori
{
ZFP_ARRAY_TYPE::view v(&arr, offset, viewLen);
size_t i = 1;
SCALAR val = 3.14;
SCALAR val = SCALAR(3.14);

EXPECT_NE(val, arr(offset + i));
v(i) = val;
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/testArray2ViewsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_view_when_setEntryWithParens_then_ori
{
ZFP_ARRAY_TYPE::view v(&arr, offsetX, offsetY, viewLenX, viewLenY);
size_t i = 1, j = 2;
SCALAR val = 3.14;
SCALAR val = SCALAR(3.14);

EXPECT_NE(val, arr(offsetX + i, offsetY + j));
v(i, j) = val;
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/testArray3ViewsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_view_when_setEntryWithParens_then_ori
{
ZFP_ARRAY_TYPE::view v(&arr, offsetX, offsetY, offsetZ, viewLenX, viewLenY, viewLenZ);
size_t i = 1, j = 2, k = 1;
SCALAR val = 3.14;
SCALAR val = SCALAR(3.14);

EXPECT_NE(val, arr(offsetX + i, offsetY + j, offsetZ + k));
v(i, j, k) = val;
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/testArray4ViewsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_view_when_setEntryWithParens_then_ori
{
ZFP_ARRAY_TYPE::view v(&arr, offsetX, offsetY, offsetZ, offsetW, viewLenX, viewLenY, viewLenZ, viewLenW);
size_t i = 1, j = 2, k = 1, l = 2;
SCALAR val = 3.14;
SCALAR val = SCALAR(3.14);

EXPECT_NE(val, arr(offsetX + i, offsetY + j, offsetZ + k, offsetW + l));
v(i, j, k, l) = val;
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/testArrayViewsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_privateConstView_when_setCacheSize_th
/* this also verifies underlying array is shallow copy */
TEST_F(ARRAY_DIMS_SCALAR_TEST_VIEWS, given_privateConstViewWithDirtyCache_when_clearCache_then_entriesCleared)
{
SCALAR val = 3.3;
SCALAR val = SCALAR(3.3);
size_t i = 2;
size_t arrOffset = i;

Expand Down
2 changes: 1 addition & 1 deletion tests/array/utils/gtestBaseFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CArrayNdTestFixture : public ::testing::TestWithParam<testConfig> {
protected:
static double getRate(int param) { return std::ldexp(1.0, param + 3); }
static unsigned int getPrecision(int param) { return 1u << (param + 3); }
static double getTolerance(int param) { return std::ldexp(1.0, -(1u << param)); }
static double getTolerance(int param) { return std::ldexp(1.0, -(1 << param)); }

// get(0): config mode selection
// get(1): config mode value selection
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/zfpCompressionParams.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ computeFixedRateParam(int param)
double
computeFixedAccuracyParam(int param)
{
return ldexp(1.0, -(1u << param));
return ldexp(1.0, -(1 << param));
}

0 comments on commit 25e9d74

Please sign in to comment.