5252// THAN A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED.
5353// /////////////////////////////////////////////////////////////////////////
5454
55- #define BOOST_TEST_MAIN
56- #include < boost/test/unit_test.hpp>
57- #include < boost/filesystem.hpp>
58- #include < boost/test/floating_point_comparison.hpp>
55+ #include < OpenImageIO/unittest.h>
5956
6057#include < libraw/libraw.h>
6158
6562using namespace std ;
6663using namespace rta ;
6764
68- BOOST_AUTO_TEST_CASE ( TestIDT_CcttoMired )
65+ void testIDT_CcttoMired ( )
6966{
7067
7168 DNGIdt *di = new DNGIdt ();
7269 double cct = 6500.0 ;
7370 double mired = di->ccttoMired ( cct );
7471 delete di;
7572
76- BOOST_CHECK_CLOSE ( mired, 153.8461538462 , 1e-5 );
73+ OIIO_CHECK_EQUAL_THRESH ( mired, 153.8461538462 , 1e-5 );
7774};
7875
79- BOOST_AUTO_TEST_CASE ( TestIDT_RobertsonLength )
76+ void testIDT_RobertsonLength ( )
8077{
8178
8279 DNGIdt *di = new DNGIdt ();
@@ -88,12 +85,12 @@ BOOST_AUTO_TEST_CASE( TestIDT_RobertsonLength )
8885 double rLength = di->robertsonLength ( uvVector, uvtVector );
8986 delete di;
9087
91- BOOST_CHECK_CLOSE ( rLength, 0.060234937 , 1e-5 );
88+ OIIO_CHECK_EQUAL_THRESH ( rLength, 0.060234937 , 1e-5 );
9289};
9390
9491DNGIdt *openFile ( std::string path, LibRaw &rawProcessor )
9592{
96- boost ::filesystem::path pathToRaw = boost ::filesystem::absolute (
93+ std ::filesystem::path pathToRaw = std ::filesystem::absolute (
9794 " ../../unittest/materials/blackmagic_cinema_camera_cinemadng.dng" );
9895 int ret = rawProcessor.open_file ( ( pathToRaw.string () ).c_str () );
9996 ret = rawProcessor.unpack ();
@@ -140,17 +137,17 @@ DNGIdt *openFile( std::string path, LibRaw &rawProcessor )
140137 return new DNGIdt ( metadata );
141138}
142139
143- BOOST_AUTO_TEST_CASE ( TestIDT_LightSourceToColorTemp )
140+ void testIDT_LightSourceToColorTemp ( )
144141{
145142 DNGIdt *di = new DNGIdt ();
146143 unsigned short tag = 17 ;
147144 double ct = di->lightSourceToColorTemp ( tag );
148145 delete di;
149146
150- BOOST_CHECK_CLOSE ( ct, 2856.0 , 1e-5 );
147+ OIIO_CHECK_EQUAL_THRESH ( ct, 2856.0 , 1e-5 );
151148};
152149
153- BOOST_AUTO_TEST_CASE ( TestIDT_XYZToColorTemperature )
150+ void testIDT_XYZToColorTemperature ( )
154151{
155152 LibRaw rawProcessor;
156153 DNGIdt *di = openFile (
@@ -163,10 +160,10 @@ BOOST_AUTO_TEST_CASE( TestIDT_XYZToColorTemperature )
163160 rawProcessor.recycle ();
164161 delete di;
165162
166- BOOST_CHECK_CLOSE ( cct, 5564.6648479019 , 1e-5 );
163+ OIIO_CHECK_EQUAL_THRESH ( cct, 5564.6648479019 , 1e-5 );
167164};
168165
169- BOOST_AUTO_TEST_CASE ( TestIDT_XYZtoCameraWeightedMatrix )
166+ void testIDT_XYZtoCameraWeightedMatrix ( )
170167{
171168 LibRaw rawProcessor;
172169 DNGIdt *di = openFile (
@@ -183,10 +180,10 @@ BOOST_AUTO_TEST_CASE( TestIDT_XYZtoCameraWeightedMatrix )
183180 delete di;
184181
185182 FORI ( countSize ( matrix ) )
186- BOOST_CHECK_CLOSE ( result[i], matrix[i], 1e-5 );
183+ OIIO_CHECK_EQUAL_THRESH ( result[i], matrix[i], 1e-5 );
187184};
188185
189- BOOST_AUTO_TEST_CASE ( TestIDT_FindXYZtoCameraMtx )
186+ void testIDT_FindXYZtoCameraMtx ( )
190187{
191188 LibRaw rawProcessor;
192189 DNGIdt *di = openFile (
@@ -204,10 +201,10 @@ BOOST_AUTO_TEST_CASE( TestIDT_FindXYZtoCameraMtx )
204201 delete di;
205202
206203 FORI ( countSize ( matrix ) )
207- BOOST_CHECK_CLOSE ( result[i], matrix[i], 1e-5 );
204+ OIIO_CHECK_EQUAL_THRESH ( result[i], matrix[i], 1e-5 );
208205};
209206
210- BOOST_AUTO_TEST_CASE ( TestIDT_ColorTemperatureToXYZ )
207+ void testIDT_ColorTemperatureToXYZ ( )
211208{
212209
213210 DNGIdt *di = new DNGIdt ();
@@ -217,10 +214,10 @@ BOOST_AUTO_TEST_CASE( TestIDT_ColorTemperatureToXYZ )
217214 delete di;
218215
219216 FORI ( countSize ( XYZ ) )
220- BOOST_CHECK_CLOSE ( result[i], XYZ[i], 1e-5 );
217+ OIIO_CHECK_EQUAL_THRESH ( result[i], XYZ[i], 1e-5 );
221218};
222219
223- BOOST_AUTO_TEST_CASE ( TestIDT_MatrixRGBtoXYZ )
220+ void testIDT_MatrixRGBtoXYZ ( )
224221{
225222
226223 DNGIdt *di = new DNGIdt ();
@@ -231,10 +228,10 @@ BOOST_AUTO_TEST_CASE( TestIDT_MatrixRGBtoXYZ )
231228 delete di;
232229
233230 FORI ( countSize ( XYZ ) )
234- BOOST_CHECK_CLOSE ( result[i], XYZ[i], 1e-5 );
231+ OIIO_CHECK_EQUAL_THRESH ( result[i], XYZ[i], 1e-5 );
235232};
236233
237- BOOST_AUTO_TEST_CASE ( TestIDT_GetDNGCATMatrix )
234+ void testIDT_GetDNGCATMatrix ( )
238235{
239236 LibRaw rawProcessor;
240237 DNGIdt *di = openFile (
@@ -250,10 +247,10 @@ BOOST_AUTO_TEST_CASE( TestIDT_GetDNGCATMatrix )
250247 delete di;
251248
252249 FORIJ ( 3 , 3 )
253- BOOST_CHECK_CLOSE ( result[i][j], matrix[i][j], 1e-5 );
250+ OIIO_CHECK_EQUAL_THRESH ( result[i][j], matrix[i][j], 1e-5 );
254251};
255252
256- BOOST_AUTO_TEST_CASE ( TestIDT_GetDNGIDTMatrix )
253+ void testIDT_GetDNGIDTMatrix ( )
257254{
258255 LibRaw rawProcessor;
259256 DNGIdt *di = openFile (
@@ -269,5 +266,21 @@ BOOST_AUTO_TEST_CASE( TestIDT_GetDNGIDTMatrix )
269266 delete di;
270267
271268 FORIJ ( 3 , 3 )
272- BOOST_CHECK_CLOSE ( result[i][j], matrix[i][j], 1e-5 );
269+ OIIO_CHECK_EQUAL_THRESH ( result[i][j], matrix[i][j], 1e-5 );
273270};
271+
272+ int main ( int , char ** )
273+ {
274+ testIDT_CcttoMired ();
275+ testIDT_RobertsonLength ();
276+ testIDT_LightSourceToColorTemp ();
277+ testIDT_XYZToColorTemperature ();
278+ testIDT_XYZtoCameraWeightedMatrix ();
279+ testIDT_FindXYZtoCameraMtx ();
280+ testIDT_ColorTemperatureToXYZ ();
281+ testIDT_MatrixRGBtoXYZ ();
282+ testIDT_GetDNGCATMatrix ();
283+ testIDT_GetDNGIDTMatrix ();
284+
285+ return unit_test_failures;
286+ }
0 commit comments