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 : /// \file action_test.cpp 10 : /// \brief Add your file description here. 11 : 12 : #define BOOST_TEST_MODULE action_test 13 : #include <boost/test/included/unit_test.hpp> 14 : 15 : #include "mcrl2/core/print.h" 16 : #include "mcrl2/process/process_expression.h" 17 : 18 : using namespace mcrl2; 19 : 20 2 : BOOST_AUTO_TEST_CASE(test_main) 21 : { 22 2 : data::sort_expression X(data::basic_sort("X")); 23 2 : data::sort_expression Y(data::basic_sort("Y")); 24 : 25 3 : process::action_label aX(core::identifier_string("a"), { X }); 26 3 : process::action_label aY(core::identifier_string("a"), { Y }); 27 4 : process::action_label aXY(core::identifier_string("a"), { X, Y }); 28 3 : process::action_label bX(core::identifier_string("b"), { X }); 29 : 30 2 : data::data_expression x_X = data::variable("x", X); 31 2 : data::data_expression y_X = data::variable("y", X); 32 2 : data::data_expression y_Y = data::variable("y", Y); 33 : 34 3 : process::action a1(aX, { x_X }); 35 3 : process::action a2(aX, { y_X }); 36 4 : process::action a3(bX, { x_X }); 37 : 38 1 : BOOST_CHECK(process::equal_signatures(a1, a1)); 39 1 : BOOST_CHECK(process::equal_signatures(a1, a2)); 40 1 : BOOST_CHECK(!process::equal_signatures(a1, a3)); 41 : 42 1 : process::action_label_list l; 43 1 : l.push_front(aX); 44 1 : BOOST_CHECK(l.front()==aX); 45 1 : l.push_front(aY); 46 1 : l.push_front(aY); 47 1 : BOOST_CHECK(l.front()==aY); 48 1 : process::action_label_list l1=l; 49 1 : BOOST_CHECK(l1.front()==aY); 50 1 : BOOST_CHECK(l.front()==aY); 51 1 : process::action_label a=l.front(); 52 1 : BOOST_CHECK(a==aY); 53 1 : }