mirror of
https://github.com/boostorg/core.git
synced 2026-05-07 00:46:44 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3cd3afb69 | |||
| 378dc90a73 | |||
| cc765abfc6 |
+6
-1
@@ -30,7 +30,12 @@ environment:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: clang-win
|
||||
ADDRMD: 64
|
||||
CXXSTD: 14,17,20,latest
|
||||
CXXSTD: 14,17
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: clang-win
|
||||
ADDRMD: 64
|
||||
CXXSTD: 20,latest
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
|
||||
@@ -156,18 +156,15 @@ inline void no_throw_failed_impl(const char* expr, const char* what, const char*
|
||||
# pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||
#endif
|
||||
|
||||
// specialize test output for char pointers to avoid printing as cstring
|
||||
template <class T> inline const T& test_output_impl(const T& v) { return v; }
|
||||
inline const void* test_output_impl(const char* v) { return v; }
|
||||
inline const void* test_output_impl(const unsigned char* v) { return v; }
|
||||
inline const void* test_output_impl(const signed char* v) { return v; }
|
||||
inline const void* test_output_impl(char* v) { return v; }
|
||||
inline const void* test_output_impl(unsigned char* v) { return v; }
|
||||
inline const void* test_output_impl(signed char* v) { return v; }
|
||||
template<class T> inline const void* test_output_impl(T volatile* v) { return const_cast<T*>(v); }
|
||||
// specialize test output for pointers to avoid printing as cstring
|
||||
|
||||
template<class T> inline T const& test_output_impl( T const& v ) { return v; }
|
||||
|
||||
template<class T> inline void const* test_output_impl( T* const& v ) { return v; }
|
||||
template<class T> inline void const* test_output_impl( T volatile* const& v ) { return const_cast<T*>(v); }
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||
inline const void* test_output_impl(std::nullptr_t) { return nullptr; }
|
||||
inline const void* test_output_impl( std::nullptr_t ) { return nullptr; }
|
||||
#endif
|
||||
|
||||
// print chars as numeric
|
||||
|
||||
@@ -177,6 +177,9 @@ run lightweight_test_with_test.cpp
|
||||
: : : $(pedantic-errors) ;
|
||||
run-fail lightweight_test_with_fail.cpp ;
|
||||
|
||||
run lightweight_test_eq_ptr.cpp
|
||||
: : : $(pedantic-errors) ;
|
||||
|
||||
run is_same_test.cpp ;
|
||||
|
||||
run typeinfo_test.cpp ;
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
// Copyright 2025 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
char const* p = "12";
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t const* p = L"12";
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_CHAR16_T )
|
||||
|
||||
{
|
||||
char16_t const* p = u"12";
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_CHAR32_T )
|
||||
|
||||
{
|
||||
char32_t const* p = U"12";
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
|
||||
|
||||
{
|
||||
char8_t const* p = u8"12";
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
int v;
|
||||
int volatile* p = &v;
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
{
|
||||
int v;
|
||||
int const volatile* p = &v;
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
{
|
||||
char v;
|
||||
char volatile* p = &v;
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
{
|
||||
char v;
|
||||
char const volatile* p = &v;
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t v;
|
||||
wchar_t volatile* p = &v;
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t v;
|
||||
wchar_t const volatile* p = &v;
|
||||
|
||||
BOOST_TEST_EQ( p, p );
|
||||
BOOST_TEST_NE( p, p + 1 );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user