
//  (C) Copyright Edward Diener 2011-2015
//  Use, modification and distribution are subject to 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 <boost/vmd/elem.hpp>
#include <boost/vmd/equal.hpp>
#include <boost/detail/lightweight_test.hpp>

int main()
  {
  
#if BOOST_PP_VARIADICS
 
 #define BOOST_VMD_REGISTER_ANAME (ANAME)
 #define BOOST_VMD_REGISTER_list_data1 (list_data1)
 #define BOOST_VMD_DETECT_ANAME_ANAME
 #define BOOST_VMD_DETECT_list_data1_list_data1
 
 #define A_SEQUENCE (1,2,3) 46 (list_data1,BOOST_PP_NIL) BOOST_VMD_TYPE_SEQ ANAME
 
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE),(list_data1,BOOST_PP_NIL)));
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER),(list_data1,BOOST_PP_NIL)));
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER),((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME)));
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER),BOOST_VMD_TYPE_SEQ ANAME));
 
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE),));
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER),));
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_AFTER),(,)));
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER),));
 
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_LIST,(list_data1,BOOST_PP_NIL)),BOOST_VMD_TYPE_SEQ ANAME)));
 
 BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST),((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME)));
 
#else

BOOST_ERROR("No variadic macro support");
  
#endif

  return boost::report_errors();
  
  }
