• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
32   BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY4,ANARRAY5));
33   BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY2,ANARRAY3));
34   BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ANARRAY2));
35   BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY5,ANARRAY6));
36 
37 #else
38 
39 BOOST_ERROR("No variadic macro support");
40 
41 #endif
42 
43   return boost::report_errors();
44 
45   }
46