X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fpixel_formats_test.cc;h=f99bd717cdbe0d70c0c4ea4e3ad6a5d204a7c6cd;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=08c9f2d2def524e250692d67be7bcdc498ba5d35;hpb=996b0c06e23bcb6b300d7b8799df94993692e07d;p=dcpomatic.git diff --git a/test/pixel_formats_test.cc b/test/pixel_formats_test.cc index 08c9f2d2d..f99bd717c 100644 --- a/test/pixel_formats_test.cc +++ b/test/pixel_formats_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington 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 @@ -17,9 +17,27 @@ */ +/** @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 +#include +extern "C" { +#include +#include +} +#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) @@ -33,7 +51,7 @@ struct Case bpp[1] = b1; bpp[2] = b2; } - + AVPixelFormat format; int components; int lines[3]; @@ -62,7 +80,8 @@ BOOST_AUTO_TEST_CASE (pixel_formats_test) f->width = 640; f->height = 480; f->format = static_cast (i->format); - 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]);