2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-27 17:12:10 +00:00

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]
This commit is contained in:
Mateusz Loskot
2019-01-19 15:05:35 +01:00
committed by GitHub
parent 585e9226c8
commit e22c7cb108
2 changed files with 13 additions and 8 deletions

View File

@@ -18,14 +18,18 @@ namespace fixture = boost::gil::test::fixture;
template <typename ChannelFixtureBase>
void test_channel_relation()
{
fixture::channel<ChannelFixtureBase> f;
using fixture_t = fixture::channel<ChannelFixtureBase>;
using channel_value_t = typename fixture_t::channel_value_t;
channel_value_t const one = 1;
fixture_t f;
BOOST_TEST(f.min_v_ <= f.max_v_);
BOOST_TEST(f.max_v_ >= f.min_v_);
BOOST_TEST(f.min_v_ < f.max_v_);
BOOST_TEST(f.max_v_ > f.min_v_);
BOOST_TEST(f.max_v_ != f.min_v_);
BOOST_TEST(f.min_v_ == f.min_v_);
BOOST_TEST(f.min_v_ != 1); // comparable to integral
BOOST_TEST(f.min_v_ != one); // comparable to integral
}
BOOST_AUTO_TEST_CASE_TEMPLATE(channel_value, Channel, fixture::channel_byte_types)