LCOV - code coverage report
Current view: top level - bes/test - bdd_test.cpp (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 24 24 100.0 %
Date: 2019-06-26 00:32:26 Functions: 4 4 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             : #include "mcrl2/bes/bdd_expression.h"
      13             : #include "mcrl2/bes/print.h"
      14             : #include <boost/test/minimal.hpp>
      15             : 
      16             : using namespace mcrl2;
      17             : using namespace mcrl2::bdd;
      18             : 
      19           1 : void test_bdd()
      20             : {
      21           2 :   if_ b1("b1", true_(), false_());
      22           2 :   if_ b2("b2", b1, b1);
      23           2 :   if_ b3("b3", b2, b1);
      24           1 :   std::cout << "b1 = " << b1 << std::endl;
      25           1 :   std::cout << "b2 = " << b2 << std::endl;
      26           1 :   std::cout << "b3 = " << b3 << std::endl;
      27           1 :   BOOST_CHECK(bdd::pp(true_()) == "true");
      28           1 :   BOOST_CHECK(bdd::pp(b1) == "if(true, false)");
      29           1 :   BOOST_CHECK(bdd::pp(b2) == "if(if(true, false), if(true, false))");
      30           1 :   BOOST_CHECK(bdd::pp(b3) == "if(if(if(true, false), if(true, false)), if(true, false))");
      31           1 :   BOOST_CHECK(is_if(b1));
      32           1 :   BOOST_CHECK(b2.left() == b1);
      33           1 :   BOOST_CHECK(b2.right() == b1);
      34           1 :   BOOST_CHECK(b3.left() == b2);
      35           1 :   BOOST_CHECK(b3.right() == b1);
      36           1 :   BOOST_CHECK(b1.name() == core::identifier_string("b1"));
      37           1 :   BOOST_CHECK(b2.name() == core::identifier_string("b2"));
      38           1 :   BOOST_CHECK(b3.name() == core::identifier_string("b3"));
      39           1 : }
      40             : 
      41           1 : int test_main(int argc, char* argv[])
      42             : {
      43           1 :   test_bdd();
      44             : 
      45           1 :   return 0;
      46           3 : }

Generated by: LCOV version 1.12