1
2 // (C) Copyright Edward Diener 2011-2015
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
6
7 #include <boost/vmd/equal.hpp>
8 #include <boost/vmd/not_equal.hpp>
9 #include <boost/detail/lightweight_test.hpp>
10
main()11 int main()
12 {
13
14 #if BOOST_PP_VARIADICS
15
16 #define BOOST_VMD_REGISTER_aaa (aaa)
17 #define BOOST_VMD_REGISTER_bbb (bbb)
18 #define BOOST_VMD_REGISTER_ccc (ccc)
19 #define BOOST_VMD_REGISTER_ddd (ddd)
20 #define BOOST_VMD_DETECT_aaa_aaa
21 #define BOOST_VMD_DETECT_bbb_bbb
22 #define BOOST_VMD_DETECT_ccc_ccc
23 #define BOOST_VMD_DETECT_ddd_ddd
24
25 #define ANARRAY (3,(aaa,bbb,38))
26 #define ANARRAY2 (3,(bbb,aaa,38))
27 #define ANARRAY3 (3,(bbb,aaa,38))
28 #define ANARRAY4 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2))))
29 #define ANARRAY5 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2))))
30 #define ANARRAY6 (4,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2),37)))
31 #define ATUPLE (aaa)
32 #define ATUPLE2 (aaa)
33
34 BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY4,ANARRAY5,BOOST_VMD_TYPE_ARRAY));
35 BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY2,ANARRAY3,BOOST_VMD_TYPE_ARRAY));
36 BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ANARRAY2,BOOST_VMD_TYPE_ARRAY));
37 BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY5,ANARRAY6,BOOST_VMD_TYPE_ARRAY));
38 BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE,ATUPLE2,BOOST_VMD_TYPE_ARRAY));
39
40 #else
41
42 BOOST_ERROR("No variadic macro support");
43
44 #endif
45
46 return boost::report_errors();
47
48 }
49