1// Copyright 2021 Peter Dimov
2// Distributed under the Boost Software License, Version 1.0.
3// https://www.boost.org/LICENSE_1_0.txt
4
5#include <boost/describe/detail/pp_utilities.hpp>
6#include <boost/describe/detail/config.hpp>
7#include <boost/core/lightweight_test.hpp>
8
9#if !defined(BOOST_DESCRIBE_CXX11)
10
11#include <boost/config/pragma_message.hpp>
12
13BOOST_PRAGMA_MESSAGE("Skipping test because C++11 is not available")
14int main() {}
15
16#else
17
18#define S(x) S2(x)
19#define S2(x) S3(x)
20#define S3(x) #x
21
22#define F(a, x) (a, x)
23
24#if defined(_MSC_VER)
25# pragma warning(disable: 4003) // not enough arguments for macro invocation
26#endif
27
28char const * s1 = S(BOOST_DESCRIBE_PP_CALL(F, a, x));
29char const * s2 = "" S(BOOST_DESCRIBE_PP_CALL(F, a, ));
30char const * s3 = S(BOOST_DESCRIBE_PP_CALL(F, a, () x));
31char const * s4 = S(BOOST_DESCRIBE_PP_CALL(F, a, (b, c) x));
32
33int main()
34{
35 BOOST_TEST_CSTR_EQ( s1, "(a, x)" );
36 BOOST_TEST_CSTR_EQ( s2, "" );
37 BOOST_TEST_CSTR_EQ( s3, "(a, () x)" );
38 BOOST_TEST_CSTR_EQ( s4, "(a, (b, c) x)" );
39
40 return boost::report_errors();
41}
42
43#endif // !defined(BOOST_DESCRIBE_CXX11)
44

source code of boost/libs/describe/test/pp_call_test.cpp