Line data Source code
1 : // Author(s): Wieger Wesselink
2 : // Copyright: see the accompanying file COPYING or copy at
3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4 : //
5 : // Distributed under the Boost Software License, Version 1.0.
6 : // (See accompanying file LICENSE_1_0.txt or copy at
7 : // http://www.boost.org/LICENSE_1_0.txt)
8 : //
9 :
10 : #define BOOST_TEST_MODULE constructors
11 : #include <boost/test/included/unit_test.hpp>
12 :
13 : #include "mcrl2/atermpp/aterm_string.h"
14 : #include "mcrl2/atermpp/aterm_io.h"
15 :
16 : using namespace atermpp;
17 :
18 2 : BOOST_AUTO_TEST_CASE(test_main)
19 : {
20 1 : aterm_int i(10);
21 2 : atermpp::aterm x=aterm_appl(function_symbol("x",0));
22 2 : atermpp::aterm y=aterm_appl(function_symbol("y",0));
23 2 : aterm_appl f(function_symbol("f", 2), x, y);
24 1 : BOOST_CHECK(pp(f) == "f(x,y)");
25 2 : aterm_appl f1(function_symbol("f", 0));
26 1 : BOOST_CHECK(pp(f1) == "f");
27 :
28 2 : function_symbol f2("f2", 8);
29 1 : aterm_int d(1);
30 1 : aterm_appl long_term(f2,d,d,d,d,d,d,d,d);
31 1 : BOOST_CHECK(pp(long_term) == "f2(1,1,1,1,1,1,1,1)");
32 :
33 2 : function_symbol f3("f2", 16);
34 1 : aterm_appl very_long_term(f3,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d);
35 1 : BOOST_CHECK(pp(very_long_term) == "f2(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)");
36 :
37 2 : atermpp::aterm_string s("s"); // g++ 3.4.4 complains if atermpp:: is removed :-(
38 : // aterm_string s1("s1(x)"); will generate an error!
39 1 : }
|