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
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 #93Closes#229
Test bit_aligned_pixel_reference and packed_pixel as well as
some of related metafunctions generating types of their
members and intermediate specializations.
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.
* 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.
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.
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.
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
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.
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.
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]
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
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
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.
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.
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.
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.
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
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
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.
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.
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.
* 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.
* 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
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.
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.
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.
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.
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.
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.