LCOV - code coverage report
Current view: top level - bes/test - bdd_test.cpp (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 23 23 100.0 %
Date: 2019-09-14 00:54:39 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Author(s): Jeroen Keiren
       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 bes_test.cpp
      10             : /// \brief Some tests for BES.
      11             : 
      12             : #define BOOST_TEST_MODULE bes_test
      13             : #include "mcrl2/bes/bdd_expression.h"
      14             : #include "mcrl2/bes/print.h"
      15             : #include <boost/test/included/unit_test_framework.hpp>
      16             : 
      17             : using namespace mcrl2;
      18             : using namespace mcrl2::bdd;
      19             : 
      20           1 : void test_bdd()
      21             : {
      22           2 :   if_ b1("b1", true_(), false_());
      23           2 :   if_ b2("b2", b1, b1);
      24           2 :   if_ b3("b3", b2, b1);
      25           1 :   std::cout << "b1 = " << b1 << std::endl;
      26           1 :   std::cout << "b2 = " << b2 << std::endl;
      27           1 :   std::cout << "b3 = " << b3 << std::endl;
      28           1 :   BOOST_CHECK(bdd::pp(true_()) == "true");
      29           1 :   BOOST_CHECK(bdd::pp(b1) == "if(true, false)");
      30           1 :   BOOST_CHECK(bdd::pp(b2) == "if(if(true, false), if(true, false))");
      31           1 :   BOOST_CHECK(bdd::pp(b3) == "if(if(if(true, false), if(true, false)), if(true, false))");
      32           1 :   BOOST_CHECK(is_if(b1));
      33           1 :   BOOST_CHECK(b2.left() == b1);
      34           1 :   BOOST_CHECK(b2.right() == b1);
      35           1 :   BOOST_CHECK(b3.left() == b2);
      36           1 :   BOOST_CHECK(b3.right() == b1);
      37           1 :   BOOST_CHECK(b1.name() == core::identifier_string("b1"));
      38           1 :   BOOST_CHECK(b2.name() == core::identifier_string("b2"));
      39           1 :   BOOST_CHECK(b3.name() == core::identifier_string("b3"));
      40           1 : }
      41             : 
      42           3 : BOOST_AUTO_TEST_CASE(test_main)
      43             : {
      44           1 :   test_bdd();
      45           4 : }

Generated by: LCOV version 1.12