test/data updates.
[dcpomatic.git] / test / pixel_formats_test.cc
index b788b321972f979a7c841dab904f28251aef62e6..68d225e6efa36dc6b69a5b30f8319b7e6da74eaa 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
+/** @file  src/pixel_formats_test.cc
+ *  @brief Make sure that Image::lines() and Image::bytes_per_pixel() return the right
+ *  things for various pixel formats.
+ *
+ *  @see test/image_test.cc
+ */
+
+#include <boost/test/unit_test.hpp>
+#include <list>
+extern "C" {
+#include <libavutil/pixfmt.h>
+#include <libavcodec/avcodec.h>
+}
+#include "lib/image.h"
+
 using std::list;
 using std::cout;
 
+/** @struct Case
+ *  @brief  A test case for pixel_formats_test.
+ */
 struct Case
 {
        Case (AVPixelFormat f, int c, int l0, int l1, int l2, float b0, float b1, float b2)
@@ -43,9 +61,6 @@ struct Case
 
 BOOST_AUTO_TEST_CASE (pixel_formats_test)
 {
-       /* This needs to happen in the first test */
-       dvdomatic_setup ();
-
        list<Case> cases;
        cases.push_back(Case(AV_PIX_FMT_RGB24,       1, 480, 480, 480, 3, 0,   0  ));
        cases.push_back(Case(AV_PIX_FMT_RGBA,        1, 480, 480, 480, 4, 0,   0  ));
@@ -65,8 +80,8 @@ BOOST_AUTO_TEST_CASE (pixel_formats_test)
                f->width = 640;
                f->height = 480;
                f->format = static_cast<int> (i->format);
-                av_frame_get_buffer (f, true);
-               SimpleImage t (f);
+               av_frame_get_buffer (f, true);
+               Image t (f);
                BOOST_CHECK_EQUAL(t.components(), i->components);
                BOOST_CHECK_EQUAL(t.lines(0), i->lines[0]);
                BOOST_CHECK_EQUAL(t.lines(1), i->lines[1]);