From d112d23e9de7378faad70cfe1a53da0281cd0c39 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 11 Oct 2019 16:02:45 +0300 Subject: [PATCH] Test that BOOST_TEST_EQ doesn't emit sign-compare warnings --- test/Jamfile.v2 | 1 + test/lightweight_test_test5.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/lightweight_test_test5.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d45b50d..d033dbf 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -75,6 +75,7 @@ run lightweight_test_gt_ge_test.cpp ; run lightweight_test_eq_nullptr.cpp ; run lightweight_test_test3.cpp ; run lightweight_test_test4.cpp ; +run lightweight_test_test5.cpp : : : extra msvc:on gcc:on clang:on ; run-fail lightweight_test_all_eq_test.cpp ; run-fail lightweight_test_all_with_fail.cpp ; diff --git a/test/lightweight_test_test5.cpp b/test/lightweight_test_test5.cpp new file mode 100644 index 0000000..78870d1 --- /dev/null +++ b/test/lightweight_test_test5.cpp @@ -0,0 +1,19 @@ +// +// Test that BOOST_TEST_EQ doesn't emit sign compare warnings +// +// Copyright 2019 Peter Dimov +// +// 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 +// + +#include + +int main() +{ + BOOST_TEST_EQ(1, 1u); + BOOST_TEST_EQ(~0u, -1); + + return boost::report_errors(); +}