Commit Graph

199 Commits

Author SHA1 Message Date
Mateusz Łoskot
6832ad6ac6
Ignore -Wsign-conversion warning from Boost.Test 2019-05-02 10:05:09 +02:00
Mateusz Łoskot
e0c27a337a
Disable free operator* of point<T> for non-arithmetic operand (#295)
Add Boost.Build-only test to verify compilation failure.

Fixes #289 as much better solution than #294 workaround.
Closes #294
2019-04-29 20:59:51 +02:00
Mateusz Łoskot
c9ccc83551
Officially drop support for GCC <= 4.8 (#296)
Although GCC 4.8 is labelled as C++11 compatible, the reasons are:

* GCC 4.8 is buggy enough to prevent reasonable use of Boost.MP11
* GCC 4.8 is dying

Closes #282
2019-04-28 15:50:56 +02:00
Mateusz Łoskot
5611bd5807
Replace Boost.MPL with Boost.MP11 (#274)
Use type traits and features of C++11, then use Boost.MP11.
Remove unused and unnecessary metafunctions in `detail` namespace.
Remove explicit access to ::type as no longer necessary with MP11.
Clean up and reformat code according to the current guidelines.

Legacy tests have been updated where necessary to accommodate
switch to MP11.

Replace std::is_integral with gil::detail::is_channel_integral
Replacing boost::is_integral with std::is_integral is C++ UB:

    C++11 / 20.11.2 Header <type_traits> synopsis
    1 The behavior of a program that adds specializations for any
    of the class templates defined in this subclause is undefined
    unless otherwise specified.


Implements also proposal in #93
Closes #229
2019-04-14 22:13:45 +02:00
Mateusz Łoskot
a0c5eb3d35
[test] Fix CMake status message [ci skip] 2019-04-13 19:10:09 +02:00
Mateusz Łoskot
7db51faff3
Cast scoped_channel_value to integer prior comparin to an integer 2019-04-09 22:09:34 +02:00
Mateusz Łoskot
8d2a90bf1b
Add missing #include <iostream> in test 2019-04-02 22:08:51 +02:00
Mateusz Łoskot
c6c5336cc0
Value-initialize channel and pixel value members (#273)
Add tests to ensure member values of channel and pixel classes are
determined, zero-initialized.
Fixes #270

Tidy up formatting.
2019-04-01 17:19:22 +01:00
Mateusz Łoskot
715d760be8
Add build-project color missing from test/Jamfile 2019-03-25 20:38:17 +01:00
Mateusz Łoskot
35d7e57a41
Update test of packed_pixel with run-time checks (#269)
Test additional packed_pixel variants for 3-bit gray and 535-bits rgb.
2019-03-25 08:02:19 +01:00
Mateusz Łoskot
0f9b6c4ddf
Add test for packed_channel_value and is_integral specialization (#268) 2019-03-25 07:54:29 +01:00
Mateusz Łoskot
d381474813
Fix warnings about unused variables in tests [ci skip] 2019-03-21 19:33:11 +01:00
Mateusz Łoskot
b4a7fda6d6
Fix warning: no return statement in function returning non-void 2019-03-21 18:33:54 +01:00
Mateusz Łoskot
11e8fee5d4
Fix warning about unreferenced local variable 2019-03-21 09:43:28 +01:00
Nikita Kniazev
33d4ac05ae Use just ::value where is possible (#262)
The ::value member is common convention of all MPL and TypeTraits metafunctions.

Fixes VS2015 failures (#261)
2019-03-19 20:34:11 +01:00
Mateusz Łoskot
d3c1a2eff4
Add test for some bit-aligned pixel types and metafunctions (#257)
Test bit_aligned_pixel_reference and packed_pixel as well as
some of related metafunctions generating types of their
members and intermediate specializations.
2019-03-13 19:15:33 +01:00
Mateusz Łoskot
a0f3bb7659
Use class for template template parameter (#251)
The current definition using `typename` fails when compiling
with GCC 4.8 and 4.9, because `typename` is allowed since C++17.
2019-03-05 07:54:14 +01:00
Mateusz Łoskot
b1998d9a74
Add pixel test fixture with all core pixel types (#248)
Add test for pixel_reference_is_mutable metafunction.

From the legacy tests
- port value_core and reference_core fixtures, see
  https://lists.boost.org/boost-gil/2019/02/0138.php
- port representative pixel types and verify with tests of some
  metafunctions.

Clean up test names for CTest in the CMake configuration.
Disable some GCC/clang warnings in tests to avoid CI build
termination due to too long logs.
2019-03-02 23:18:54 +01:00
Mateusz Łoskot
5323eb7c5a
Remove repeated gray16_pixel_t from test list 2019-03-01 00:44:36 +01:00
Mateusz Łoskot
d73e6415c8
Rename channel_test_fixture.hpp to test_fixture.hpp
* It lives in channel/ directory, so the prefix is superfluous
* New name makes a convention for fixture headers for other test topics

Add missing and rename existing include guards.
2019-02-28 21:40:44 +01:00
Mateusz Łoskot
61c23b0529
Add test for some channel, color and pixel metafunctions (#247) 2019-02-27 08:19:44 +01:00
Mateusz Łoskot
1541d5cf8a
Add test for pixels_are_compatible metafunction (#245) 2019-02-26 22:14:34 +01:00
Mateusz Łoskot
998d1b1bbe
Add tests for dynamic_{x,y}_step_type specializations (#243)
Basic verification expected specializations of `dynamic_x_step_type`
and `dynamic_y_step_type` are in place.
2019-02-25 07:11:46 +00:00
Mateusz Łoskot
213b55c6ad
Add test for iterator concepts (#242) 2019-02-24 18:15:06 +00:00
Mateusz Łoskot
48db4f51a3
Add test for locator concepts (#241) 2019-02-23 11:16:57 +00:00
Mateusz Łoskot
cf6627389f
Update test/channel/concepts.cpp name in build config
Change missing from SHA-1:3d8469eafe59bc3fef3052bad375704614023e9d
2019-02-22 22:09:23 +01:00
Mateusz Łoskot
3d8469eafe
Require BOOST_GIL_USE_CONCEPT_CHECK when compiling test/*/concepts.cpp
Add BOOST_GIL_USE_CONCEPT_CHECK define to CMakeLists.txt files.
Rename channel_concepts.cpp to concepts.cpp.
2019-02-22 22:02:25 +01:00
Mateusz Łoskot
9b1bd58202
Fix year in copyright notice [ci skip] 2019-02-21 00:33:24 +01:00
Mateusz Łoskot
8e7bda62f5
Move GIL's original test suites to test/legacy/ (#239)
Document maintenance rules of `test/legacy/` content.

Motivation to move the `test/legacy/` is to:
* clarify status of those tests
* make it easier to run tests selectively
* separate new/upcoming feature-specific tests
  from those all-in-one tests.

Other changes:
Rename `gil_test_common.hpp` to `unit_test.hpp` to make
it clearer it acts as `boost/test/unit_test.hpp proxy`.
Remove `<include>$(BOOST_ROOT)` from `Jamfile`-s as unnecessary.
2019-02-20 19:03:28 +00:00
Mateusz Łoskot
5f241af90d
[ci] Ensure CI builds clone pre-determined super-project branch
Rename custom variant with gil_ prefix.
Do not define project ID from Jamfile-s as unnecessary.
The project ID-s and build features are global resources, easy to clash.

Add recently added test/ subdirectories to build.
2019-02-19 18:21:28 +01:00
Mateusz Łoskot
e72e3862c2
Add tests for image_view metafunctions, image and pixel concepts (#236)
Rename test source files xxx_concepts.cpp to concepts.cpp
2019-02-18 21:52:30 +00:00
Mateusz Łoskot
f4133c8068
Ignore warning -Wuninitialized in concepts 2019-02-06 22:23:38 +01:00
Mateusz Łoskot
bde46642d3
Ignore warning -Wfloat-equal in tests 2019-02-06 22:22:35 +01:00
Mateusz Łoskot
6763a8cd98
Build core tests with BOOST_GIL_USE_CONCEPT_CHECK defined (#230)
when building tests with both, Boost.Build and CMake.

Disable concepts check for tests where range (e.g. std::array)
used as image pixel - not fully specialised as acceptable pixel type.

Ignore warnings from boost/concept_check.hpp
Rationalise uses of GCC and clang diagnostic push/pop,
with adding constraint for GCC 4.6+ as minimum version
where the pragma was introduced.

Closes #228
2019-02-05 22:19:35 +00:00
Mateusz Łoskot
2dc8ad8fac
Ignore -Wfloat-equal warning in old test code
This ignores the warning in the test code only, not in GIL headers and
the old test has compared float-point numbers with == or  != forever,
so this does not ignore anything new.
2019-02-04 23:09:17 +01:00
Mateusz Łoskot
45ca507ca3
Replace some uses of boost::is_same with std::is_same (#225)
Those are places boost::is_same can be replaced in non-intrusive way.
Remaining are types derived from boost::is_same, where the replacing
would affect all their uses - effectively switching from boost::true_/false_ types
to std::true_type and std::false_type.
Such change needs to come along with Boost.MPL to MP11 migration.
2019-01-27 10:54:05 +00:00
Mateusz Loskot
e22c7cb108
Fix GCC -Wsign-compare warning in tests (#217)
Fixes at least two warnings issued by channel tests due to
comparison of unsigned channel value with signed integer 1:

../../boost/test/tools/assertion.hpp:72:13:
  warning: comparison between signed and unsigned
    integer expressions [-Wsign-compare]
2019-01-19 15:05:35 +01:00
Mateusz Łoskot
e3ef52bb80
Correct order of constexpr and type specifier
The constexpr belongs to the declaration specifiers (like static) and
not just the type specifiers (like cv-qualifiers), so it binds to
the declaration (like static), not the type (like const).

Refines #211
2019-01-15 00:42:20 +01:00
Mateusz Loskot
78b7dcfeca
Remove uses of Boost.Bind and Boost.Lambda (#212)
Replace with std::bind and C++11 lambda functions.
The two Boost libraries should no longer be a direct
dependency of Boost.GIL.
2019-01-13 02:03:25 +01:00
Mateusz Loskot
a2b2ca977a
Replace BOOST_STATIC_CONSTANT with constexpr (#211)
Tidy up formatting of refactored parts of code.
2019-01-12 23:57:35 +01:00
Mateusz Loskot
f578a8be9c
Replace assert() macro with BOOST_ASSERT() macro (#208)
Add #include <boost/assert.hpp> where necessary.
Apply minor clean-up near the macro replacements.

Closes #96
2019-01-12 10:21:01 +01:00
Mateusz Loskot
6e3ccc00b1
Remove dependency on Boost.StaticAssert (#207)
Replaced BOOST_STATIC_ASSERT with C++11 binary static_assert,
with empty message.

In future, this should make it possible to automatically refactor
into C++17 unary static_assert using clang-tidy and
its modernize-unary-static-assert check.

Closes #106
2019-01-11 10:33:09 +01:00
Mateusz Łoskot
73edd31781
[cmake] Add GIL_BUILD_HEADERS_TESTS option [ci skip]
Allows to avoid generating lots of headers tests,
if unnecessary, e.g. while developing in IDE.
2019-01-05 23:01:37 +01:00
Mateusz Łoskot
a92ea3133b
[cmake] Skip tests for IO RAW headers if libraw not found [ci skip] 2019-01-04 14:39:56 +01:00
Mateusz Łoskot
86a30a2484 Switch from header-only to linked boost_unit_test_framework
The linked variant of the Boost.UTF seems recommended.
It may help to avoid mysterious run-time error on Mac OS:
    boost::runtime::access_to_missing_argument:
    There is no argument provided for parameter color_output
It also may speed up compilation during CI builds.
2019-01-03 23:53:54 +01:00
Mateusz Loskot
bf67e796c6
Apply clang-tidy modernize-use-using to all tests (#199)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix`
against TU-s of all tests.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in sources of all the tests should return no matches.
2018-12-18 00:13:39 +01:00
Mateusz Łoskot
77b9da56af
[cmake] Keep main function name after switch to executable [ci skip] 2018-12-15 22:48:41 +01:00
Mateusz Łoskot
321bee2b79
[cmake] Fix missing source in add_executable [ci skip] 2018-12-15 21:56:52 +01:00
Mateusz Łoskot
293164e370
[cmake] Build header tests as executable, not OBJECT [ci skip]
Avoid file TOUCH command which requires CMake 3.12+
2018-12-15 21:42:42 +01:00
Mateusz Łoskot
96ae7e28f4
[cmake] Improve headers globbing [ci skip]
Core heades must not be globbed recursively.
2018-12-13 23:11:26 +01:00
Mateusz Łoskot
f300271fa3 [cmake] Add GIL_ENABLE_EXT_* options [ci skip] 2018-12-13 00:57:30 +01:00
Mateusz Łoskot
e99db3d0c4
[cmake] Tidy up [ci skip] 2018-12-12 14:00:13 +01:00
Mateusz Łoskot
36af17b390
[cmake] Add extensions ot all-in-one headers test
Updates #184
2018-12-11 23:22:19 +01:00
Mateusz Loskot
021e4b9d4c
[cmake] Add test with all headers included in one TU (#184) [ci skip]
Rename target test_compile_headers to test_headers_self_contained.
Add target test_headers_all_in_one
- Currently tests headers of core, concepts and io.
2018-12-11 23:17:27 +01:00
Mateusz Loskot
78110fc89c
Apply clang-tidy modernize-use-override (#182)
Used clang-tidy 7.0 with the command:

run-clang-tidy.py \
    -header-filter='boost\/gil\/.*'
    -checks='-*,modernize-use-override' -fix
2018-12-10 23:10:22 +01:00
Mateusz Łoskot
41dac11d0a [cmake] Tidy up variable reuse [ci skip] 2018-12-09 16:12:59 +01:00
Mateusz Łoskot
1c7e26ab93
[cmake] Rename target test_all_headers to test_compile_headers [ci skip] 2018-12-09 13:57:11 +01:00
Mateusz Łoskot
92cddb3f71
[cmake] Bundle all Boost and IO libraries in gil_dependencies target
Simplify generating of IO tests targets, remove lots of duplicate cruft.
Tidy up CMake scripts.
2018-12-08 23:20:54 +01:00
Mateusz Łoskot
b6e8dbbf8f
[cmake] Explain Boost regression not supposed to run headers tests [ci skip] 2018-12-08 15:59:04 +01:00
Mateusz Łoskot
ec58e31fa7
[cmake] Rename main to specific name in headers tests [ci skip]
Rename test_headers target to test_all_headers.
Rationalise use of CMake variables.
2018-12-08 12:16:32 +01:00
Mateusz Łoskot
d017298440 [cmake] Make test/headers directory is redundant or incorrect [ci skip] 2018-12-08 12:00:52 +01:00
Mateusz Łoskot
2957351f57
Add self-contained header tests to CMake configuration [ci skip]
Similarly to the tests defined in Boost.Build configuration, those do
not run on CI builds or regression builds.
2018-12-08 02:40:45 +01:00
Mateusz Łoskot
63c450c2a9
Modernize CMake configuration
Replace global compile options and definitions with interface targets.
Remove globing for headers.
Set project version based on GIL version.
Remove GIL_BUILD_TESTS option as redundant - there is no point in
using CMake for development of header-only library if no tests
are to be built.
2018-12-08 01:05:47 +01:00
Mateusz Łoskot
1075967712
Move self-contained headers test to test/headers
Modify Boost.Jam script generating tests to support targets per the library
directories/modules.
2018-12-06 22:35:39 +01:00
Mateusz Łoskot
28df5bc482
Clean up several warnings about unreferenced formal parameters
Add comment to premultiply.hpp:
- FIXME: Is c input paramater not used intentionally?
2018-10-29 15:26:53 +01:00
Mateusz Łoskot
5fd0f7878c [cmake] Prefix status messages with Boost.GIL for source clarity [ci skip]
Remove GIL_USE_BOOST_STAGE as unnecessary.
Download FindBoost.cmake for <3.13 - this module in CMake 3.13
received some important updates.
2018-10-29 14:01:48 +01:00
Mateusz Loskot
a1c966dd9b
Fix point<T> divide and multiply to not to hardcode result as point<double> (#157)
The free variants of operator/ and operator* now yield new
type of point<T> with T promoted to type common for both operands.

Add missing member operator*=, for symmetry.
Add template function iround(point<T>) as no-op sink for point
specialisations for T of integer types.
Add explicit casts of arithmetic intermediate results to avoid
compilation warnings.
Replace redundant point<T> construction in return statement with uniform
initialization.
Add static_assert validating range of axis_value integer template parameter.

Update test/point/point.cpp with basic checks of all point<T> members.

Fixes #153
2018-10-24 15:08:39 +02:00
Mateusz Loskot
53dc1a6949
Add basic tests for point<T> (#156) 2018-10-20 16:35:29 +02:00
Mateusz Łoskot
9b89b4fd9d
[cmake] Add test/image_view to CMake configuration
[ci skip]
2018-10-20 00:07:56 +02:00
Mateusz Łoskot
9426683651
[cmake] Add CMakeLists.txt for test/algorithm
Do not link lightweight_test-based tests against Boost.Test libraries.
Tidy up.

[ci skip]
2018-10-19 23:50:30 +02:00
Mateusz Loskot
ce82941fa2
Rename point2<T> to point<T> (#155)
Add point2<T> alias template for backward compatibility with Boost <=1.68.
Replace multiple point_t aliases of point<ptrdiff_t> with single defined
in point.hpp. The point_t is common used to represent dimensions.
Replace many uses of point<ptrdiff_t> with point_t.

Apply reformatting around point2 changes to respect the line length limit.

Follows up discussion in #154
2018-10-19 09:32:23 +02:00
Mateusz Łoskot
875136885a
Fix conflict with std::fill_n and boost::range::fill_n (Trac 7189)
Add minimal test for the std::fill and boost::array or std::array as
pixel type.
2018-10-12 18:34:28 +02:00
Mateusz Loskot
1f1f8836ca
Merge pull request #147 from mloskot/ml/add-headers-compile-test
Add test to verify headers are self-contained
2018-10-05 21:35:16 +02:00
Mateusz Łoskot
9dc67eae1d
Add test to verify headers are self-contained
For each header, a translation unit is generated along with
corresponding compile target.
Currently, only boost/gil/*.hpp and boost/gil/io/* headres are included.

On CI services, compile self_contained_headers targets only if
TEST_HEADERS environment variable is set. This is to avoid build
timeouts due to CI services limits.
When running b2 locally, the tests are compiled by default.
2018-10-05 18:11:08 +02:00
Mateusz Łoskot
e4e72b5ee4
Add explicit conversion of arithmetic result to expected result type
Fixes warnings due to implicit promotion of operands, then implicit
conversion.
2018-09-28 23:43:02 +02:00
Mateusz Łoskot
32fec9f05b
Refactor library includes to #include <boost/gil/...>
Group include directives, sort within group:
* In headers of GIL core and extensions:
  1. boost/gil/extension/*
  2. boost/gil/*
  3. boost/*
  4. C++ standard library headers
* In programs:
  1. boost/gil/*
  2. boost/*
  3. C++ standard library headers
  4. "xxx.hpp" for local headers
Add basic guidelines to CONTRIBUTING.md.
Add/Remove #include <boost/config.hpp> or std headers un/necessary.
Rename gil_concept.hpp to concepts.hpp.
Remove gil_all.hpp - we already have all-in-one boost/gil.hpp.
Tidy up and unify copyright and license header.
Tidy up formatting and excessive whitespaces in some comments.
Remove Doxygen block with file description, author, date, etc.
Remove dead or commented pragmas and directives.
Trim trailing whitespaces.
2018-09-28 16:26:34 +02:00
Mateusz Łoskot
c3bb2e1a94
Remove gil_config.hpp as unnecessary
Move BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS define setting and
documentation comment to channel.hpp where solely used.

Trim trailing whitespaces.
2018-09-27 15:38:40 +02:00
Mateusz Łoskot
609a2d3a49
Add casts to avoid warnings due to implicit integral promotions
The explicit casts help to avoid warnings when integer types
smaller than int are implicitly converted during arithmetic operations.
2018-09-24 11:11:01 +02:00
Mateusz Łoskot
afe0c2415b
Fix warning: comparing floating point with == is unsafe
Use >= trick where value is guaranteed to never be greater than comparator
but to avoid warning: comparing floating point with == is unsafe.
2018-09-24 10:42:31 +02:00
Mateusz Loskot
7a5bd6986e
Merge pull request #139 from mloskot/ml/trac-ticket-7092
Remove re-assignment of functor from for_each_pixel (Trac 7092)
2018-09-23 21:26:07 +02:00
Mateusz Łoskot
f613cc4088
Remove re-assignment of functor from for_each_pixel (Trac 7092)
The assignment was superfluous in general case and incorrect in specific
case when the algorithm was given a lambda expression.
The copy assignment operator is defined as deleted for lambda
expressions.

Add minimal test for for_each_pixel algorithm to verify it compiles with
lambda expression.
2018-09-21 18:50:40 +02:00
Mateusz Łoskot
ecc19de7c9
Simplify and clean up Jamfiles
Rename Jamfile.v2 to Jamfile - BBV1 is dead.
Remove numeric/test/test.cpp as redundant.
2018-09-21 18:02:37 +02:00
Mateusz Łoskot
b1eaa7ea90 Update image_view to model Collection concept (Trac 2222)
* Applies patch from John Femiani submitted via Trac
  https://svn.boost.org/trac10/ticket/2222 description:
  It would be convenient if GIL views modeled ReversibleCollection concept.
  In fact they almost do already. Without modeling this concept, it is
  hard to use an image view with boost::range algorithms.
* Add related image_view concepts for Collection, ForwardCollection,
  ReversibleCollection.
* Add tests for the new concepts.
* Add run-time tests for the new image_view methods.
2018-08-29 22:10:18 +02:00
Mateusz Łoskot
4c9ba74769 Replace lightweight_test_traits.hpp with lightweight_test.hpp 2018-08-29 18:04:06 +02:00
Mateusz Łoskot
85dbc8c21f Switch image_view tests from Boost.Test to Boost.Core.LightweightTest 2018-08-29 17:55:46 +02:00
Mateusz Łoskot
4500543a74 Add missing template keyword prior to dependent name axis_iterator (Trac 8896)
* Apply patch from https://svn.boost.org/trac10/ticket/8896
* Add compile-time test of RandomAccessNDImageViewConcept
  * Confirms the reported failure (tested with GCC 7.3 and clang 5.0)
  * Verifies correctness of the patch
2018-08-23 16:05:38 +02:00
Mateusz Łoskot
bfb0c15323 [cmake] Update FindBoost.cmake auto-download instructions [ci skip]
Add GIL_DISABLE_FINDBOOST_DOWNLAOD option (default=OFF).
Output values of Boost_INCLUDE_DIRS and BOOST_LIBRARY_DIRS
  - should help to know which Boost we are building GIL against.
Fix add_executable with empty sources list.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
2658e2059a Replace some of Boost.MPL and Boost.TypeTraits with C++11 equivalents
Non-functional refactoring of promote_integral added in #91
Clean up 128-bit support remains.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
b8af11db87 Add promote_integral metafunction
Copied from Boost.Geometry, including original tests, with some non-functional
modifications explained in the comments.
The utility can be used where it is important to avoid integer overflow.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
a6795334d3 [test] Verify channel_minmax values against std::numeric_limits 2018-06-27 00:02:27 -04:00
Mateusz Loskot
73ec99e606 Refactor single-program channel test to Boost.Test suites and cases
Motivation:
- state clearly what is covered with tests without reading non-trivial code
- avoid cleverness - tests should be no-brainer
- get closer to one test case targets one feature/beaviour with one check
- replace obscure `throw std::exception` with diagnostics that are actually
  useful to pin-point failure cause and location - makes CI logs useful.
- allow to select and run specific tests
- make tests maintenance easy, quick and fun

Propose new structure of tests that reflects the previous tests hierarchy,
but organizes channel tests in test/channel directory with test programs
each covering specific library feature (or set of closely related features).

The refactored tests cover 100% of checks from the old `channel.cpp`,
plus it refines or adds a bunch more.
NOTE: old test/channel.cpp has not been removed yet.

Common definitions from the single test/channel.cpp moved to
channel_test_fixtures.hpp and namespace boost::gil::test::fixture:
Classes and typedefs:
- `do_test` as `fixture::channel`
- `value_core` as `fixture::channel_value`
- `reference_core` as `fixture::channel_reference`
- `packed_reference_core` as `fixture::packed_channel_reference`
- `packed_dynamic_reference_core` as `fixture::packed_dynamic_channel_reference`
- `channel_archetype` and relatives to `channel_concepts.cpp` which is compile
   test in Jamfile
- `test_packed_channel_reference()` parts as `fixture::packed_channels565`
- `test_packed_dynamic_channel_reference()` parts as `fixture::packed_dynamic_channels565`
Test case functions called from `do_test<T>::test_all`:
- `test_channel_invert()` to `algorithm_channel_invert.cpp` suite
- `test_channel_convert()` to `algorithm_channel_convert.cpp` suite
- `test_channel_multiply()` to `algorithm_channel_multiply.cpp` suite
- `test_channel_math()` split to `algorithm_channel_relation.cpp`
   and `algorithm_channel_arithmetic.cpp`

Add test cases for each channel value type T as used to run from
`test_channel_value_impl<T>`, `test_packed_channel_reference<T>` and
`test_packed_dynamic_channel_reference<T>`.

Add list of possible T-s defined as type-lists `fixture::channel_byte_types`,
`fixture::channel_integer_types`, `channel_float_types` and
`channel_bitfield_types` which used with `BOOST_AUTO_TEST_CASE_TEMPLATE`
generate all possible combination of inputs.

Add new `channel_test_fixture.cpp` is a self-test suite verifying the fixtures.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
ed67f9a571 Replace bitsN[s] aliases with C++11 fixed width integer types
Import the selection of integer types into boost::gil namespace,
  and move from channel.hpp to typedefs.hpp for easier access.
Replace bits32f with float32_t and bits64f with float64_t
  - kept as alias of scoped_channel_value.
Move float64_t (bits64f) to typedefs.hpp.
Replace the four {float|double}_{zero|one} min/max channel values
  with float_point_zero and float_point_one templates.
Replace <boost/cstdint,hpp> with C++11 <cstdint>.

Introduce preference of using declaration instead of typedef.
Reformat typedefs.hpp to take advantage of the using declaration
  - works much better for left-to-right reading, alias name as
    most important detail comes first.
Add some of missing #include typedefs.hpp, sort some headers.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
1e89c764b2 [cmake] Replicate GCC/clang compile flags from Jamfile
Add headers to target sources, so they are included in generate
makefiles, scanned and inspected as regular sources.

[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
eee3c526fc Add missing #include <stdexcept>
Fix GCC 4.7 error: 'runtime_error' is not a member of 'std'
2018-06-27 00:02:27 -04:00
Mateusz Loskot
9f028e67ad Replace C++11 std::string::front with indexing operator 2018-06-27 00:02:27 -04:00
Mateusz Loskot
3e612232c2 Restore root Jamfile lost during merge of PR #13 2018-06-27 00:02:27 -04:00
Niklas Angare
acf760719c Take input filename on the command line to test/image.
This enables test runners to copy the file to the target. It also makes
the code that looks for the file in a different path unnecessary since
Boost.Build will pass the proper relative path.
2018-06-27 00:02:27 -04:00
Stefan Seefeld
1f0bc35012 Introduce top-level gil.hpp header. (#70)
Introduce top-level boost/gil.hpp header.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
a37469e3ad Extend GCC and clang cxxflags for detailed warnings
Bump MSVC warning level to W4
Preparing for detailed warnings clean up based on:
https://svn.boost.org/trac10/wiki/Guidelines/WarningsGuidelines
Group compilation flags and defines in common top-level Jamfile
- relies on Boost.Build feature of referring parent Jamfile-s.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
d754d41373 Fix MSVC warning: C4100 unreferenced formal parameter 2018-06-27 00:02:27 -04:00