-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing alignment default value in image constructor (#429)
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright 2019 Mateusz Loskot <mateusz at loskot dot net> | ||
// | ||
// Distributed under the Boost Software License, Version 1.0 | ||
// See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt | ||
// | ||
#define BOOST_TEST_MODULE gil/test/core/image/image | ||
#include "unit_test.hpp" | ||
|
||
#include <boost/gil.hpp> | ||
|
||
#include "test_fixture.hpp" | ||
#include "core/pixel/test_fixture.hpp" | ||
|
||
namespace gil = boost::gil; | ||
namespace fixture = boost::gil::test::fixture; | ||
|
||
BOOST_AUTO_TEST_CASE_TEMPLATE(constructor_with_dimensions_pixel, Image, fixture::image_types) | ||
{ | ||
gil::point_t const dimensions{256, 128}; | ||
{ | ||
using pixel_t = typename Image::view_t::value_type; | ||
pixel_t const rnd_pixel = fixture::pixel_generator<pixel_t>::random(); | ||
|
||
Image image(dimensions, rnd_pixel); | ||
BOOST_TEST(image.width() == dimensions.x); | ||
BOOST_TEST(image.height() == dimensions.y); | ||
|
||
for (pixel_t const& p : gil::view(image)) | ||
{ | ||
BOOST_TEST(p == rnd_pixel); | ||
} | ||
} | ||
} |