Skip to content

Commit e151865

Browse files
authored
Attempt to fix CI fail involving halfs (#2188)
Signed-off-by: Doug Walker <[email protected]>
1 parent 273cdfa commit e151865

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

tests/cpu/fileformats/FileFormatCTF_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5124,7 +5124,7 @@ OCIO_ADD_TEST(CTFTransform, save_lut1d_halfdomain)
51245124
}
51255125
else
51265126
{
5127-
OCIO_CHECK_EQUAL(loaded, expected);
5127+
OCIO_CHECK_EQUAL(loaded.bits(), expected.bits());
51285128
OCIO_CHECK_EQUAL(loadedVal, lut->getArray()[3 * i + 1]);
51295129
OCIO_CHECK_EQUAL(loadedVal, lut->getArray()[3 * i + 2]);
51305130
}

tests/cpu/ops/lut1d/Lut1DOpCPU_tests.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -643,25 +643,25 @@ OCIO_ADD_TEST(Lut1DRenderer, bit_depth_support)
643643

644644
cpuOp->apply(&uint8_inImg[0], &outImg[0], NB_PIXELS);
645645

646-
OCIO_CHECK_EQUAL(outImg[ 0], 0.0f);
647-
OCIO_CHECK_EQUAL(outImg[ 1], 0.0f);
648-
OCIO_CHECK_EQUAL(outImg[ 2], 0.0f);
649-
OCIO_CHECK_EQUAL(outImg[ 3], 0.0f);
650-
651-
OCIO_CHECK_CLOSE(outImg[ 4], 0.066650390625f, 1e-6f);
652-
OCIO_CHECK_CLOSE(outImg[ 5], 0.070617675781f, 1e-6f);
653-
OCIO_CHECK_CLOSE(outImg[ 6], 0.070617675781f, 1e-6f);
654-
OCIO_CHECK_EQUAL(outImg[ 7], 1.0f);
655-
656-
OCIO_CHECK_CLOSE(outImg[ 8], 0.7138671875f, 1e-6f);
657-
OCIO_CHECK_CLOSE(outImg[ 9], 0.7255859375f, 1e-6f);
658-
OCIO_CHECK_CLOSE(outImg[10], 0.7373046875f, 1e-6f);
659-
OCIO_CHECK_EQUAL(outImg[11], 0.0f);
660-
661-
OCIO_CHECK_EQUAL(outImg[12], 1.0f);
662-
OCIO_CHECK_EQUAL(outImg[13], 1.0f);
663-
OCIO_CHECK_EQUAL(outImg[14], 1.0f);
664-
OCIO_CHECK_EQUAL(outImg[15], 1.0f);
646+
OCIO_CHECK_EQUAL((float)outImg[ 0], 0.0f);
647+
OCIO_CHECK_EQUAL((float)outImg[ 1], 0.0f);
648+
OCIO_CHECK_EQUAL((float)outImg[ 2], 0.0f);
649+
OCIO_CHECK_EQUAL((float)outImg[ 3], 0.0f);
650+
651+
OCIO_CHECK_CLOSE((float)outImg[ 4], 0.066650390625f, 1e-6f);
652+
OCIO_CHECK_CLOSE((float)outImg[ 5], 0.070617675781f, 1e-6f);
653+
OCIO_CHECK_CLOSE((float)outImg[ 6], 0.070617675781f, 1e-6f);
654+
OCIO_CHECK_EQUAL((float)outImg[ 7], 1.0f);
655+
656+
OCIO_CHECK_CLOSE((float)outImg[ 8], 0.7138671875f, 1e-6f);
657+
OCIO_CHECK_CLOSE((float)outImg[ 9], 0.7255859375f, 1e-6f);
658+
OCIO_CHECK_CLOSE((float)outImg[10], 0.7373046875f, 1e-6f);
659+
OCIO_CHECK_EQUAL((float)outImg[11], 0.0f);
660+
661+
OCIO_CHECK_EQUAL((float)outImg[12], 1.0f);
662+
OCIO_CHECK_EQUAL((float)outImg[13], 1.0f);
663+
OCIO_CHECK_EQUAL((float)outImg[14], 1.0f);
664+
OCIO_CHECK_EQUAL((float)outImg[15], 1.0f);
665665
}
666666

667667
// Processing from UINT8 to F32.
@@ -878,15 +878,15 @@ OCIO_ADD_TEST(Lut1DRenderer, half)
878878
std::vector<float> outImg(2 * 4, -1.f);
879879
cpuOp->apply(&inImg[0], &outImg[0], 2);
880880

881-
OCIO_CHECK_EQUAL(outImg[0], inImg[0]);
882-
OCIO_CHECK_EQUAL(outImg[1], inImg[1]);
883-
OCIO_CHECK_EQUAL(outImg[2], inImg[2]);
884-
OCIO_CHECK_EQUAL(outImg[3], inImg[3]);
881+
OCIO_CHECK_EQUAL(outImg[0], (float)inImg[0]);
882+
OCIO_CHECK_EQUAL(outImg[1], (float)inImg[1]);
883+
OCIO_CHECK_EQUAL(outImg[2], (float)inImg[2]);
884+
OCIO_CHECK_EQUAL(outImg[3], (float)inImg[3]);
885885

886-
OCIO_CHECK_EQUAL(outImg[4], inImg[4]);
887-
OCIO_CHECK_EQUAL(outImg[5], inImg[5]);
886+
OCIO_CHECK_EQUAL(outImg[4], (float)inImg[4]);
887+
OCIO_CHECK_EQUAL(outImg[5], (float)inImg[5]);
888888
OCIO_CHECK_CLOSE(outImg[6], arbitraryVal, 1e-5f);
889-
OCIO_CHECK_EQUAL(outImg[7], inImg[7]);
889+
OCIO_CHECK_EQUAL(outImg[7], (float)inImg[7]);
890890
}
891891

892892
OCIO_ADD_TEST(Lut1DRenderer, nan)
@@ -1594,9 +1594,9 @@ OCIO_ADD_TEST(Lut1DRenderer, lut_1d_identity_half)
15941594
}
15951595
else
15961596
{
1597-
OCIO_CHECK_EQUAL(outImg[imgCntr + 0], hVal);
1598-
OCIO_CHECK_EQUAL(outImg[imgCntr + 1], hVal);
1599-
OCIO_CHECK_EQUAL(outImg[imgCntr + 2], hVal);
1597+
OCIO_CHECK_EQUAL(outImg[imgCntr + 0].bits(), hVal.bits());
1598+
OCIO_CHECK_EQUAL(outImg[imgCntr + 1].bits(), hVal.bits());
1599+
OCIO_CHECK_EQUAL(outImg[imgCntr + 2].bits(), hVal.bits());
16001600
OCIO_CHECK_EQUAL((float)outImg[imgCntr + 3], 1.f);
16011601
}
16021602
}

0 commit comments

Comments
 (0)