@@ -5725,9 +5725,9 @@ OCIO_ADD_TEST(CTFTransform, cdl_clf)
57255725 <SOPNode>
57265726 <Description>SOP description 1</Description>
57275727 <Description>SOP description 2</Description>
5728- <Slope>1, 1.1, 1.2</Slope>
5729- <Offset>0.2, 0.3, 0.4</Offset>
5730- <Power>3.1, 3.2, 3.3</Power>
5728+ <Slope>1 1.1 1.2</Slope>
5729+ <Offset>0.2 0.3 0.4</Offset>
5730+ <Power>3.1 3.2 3.3</Power>
57315731 </SOPNode>
57325732 <SatNode>
57335733 <Description>Sat description 1</Description>
@@ -5740,6 +5740,24 @@ OCIO_ADD_TEST(CTFTransform, cdl_clf)
57405740
57415741 OCIO_CHECK_EQUAL (expected.size (), outputTransform.str ().size ());
57425742 OCIO_CHECK_EQUAL (expected, outputTransform.str ());
5743+
5744+ // Now test if the read is working.
5745+
5746+ std::istringstream ctfStream;
5747+ ctfStream.str (expected);
5748+
5749+ std::string emptyString;
5750+ OCIO::LocalFileFormat tester;
5751+ OCIO::CachedFileRcPtr file = tester.read (ctfStream, emptyString, OCIO::INTERP_DEFAULT);
5752+ auto cachedFile = OCIO::DynamicPtrCast<OCIO::LocalCachedFile>(file);
5753+
5754+ const OCIO::ConstOpDataVec & opList = cachedFile->m_transform ->getOps ();
5755+ OCIO_REQUIRE_EQUAL (opList.size (), 1 );
5756+ auto cdlData = std::dynamic_pointer_cast<const OCIO::CDLOpData>(opList[0 ]);
5757+ OCIO_REQUIRE_ASSERT (cdlData);
5758+ OCIO_CHECK_EQUAL (cdlData->getSlopeParams ()[0 ], 1 .);
5759+ OCIO_CHECK_EQUAL (cdlData->getSlopeParams ()[1 ], 1.1 );
5760+ OCIO_CHECK_EQUAL (cdlData->getSlopeParams ()[2 ], 1.2 );
57435761}
57445762
57455763OCIO_ADD_TEST (CTFTransform, cdl_ctf)
@@ -5768,9 +5786,9 @@ OCIO_ADD_TEST(CTFTransform, cdl_ctf)
57685786 " <ProcessList version=\" 1.7\" id=\" cdl2\" >\n "
57695787 " <ASC_CDL inBitDepth=\" 32f\" outBitDepth=\" 32f\" style=\" Fwd\" >\n "
57705788 " <SOPNode>\n "
5771- " <Slope>1, 1.1, 1.2</Slope>\n "
5772- " <Offset>0.2, 0.3, 0.4</Offset>\n "
5773- " <Power>3.1, 3.2, 3.3</Power>\n "
5789+ " <Slope>1 1.1 1.2</Slope>\n "
5790+ " <Offset>0.2 0.3 0.4</Offset>\n "
5791+ " <Power>3.1 3.2 3.3</Power>\n "
57745792 " </SOPNode>\n "
57755793 " <SatNode>\n "
57765794 " <Saturation>2.1</Saturation>\n "
0 commit comments