LCOV - code coverage report
Current view: top level - bes/test - normal_form_test.cpp (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 20 20 100.0 %
Date: 2019-06-26 00:32:26 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          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 normal_form_test.cpp
      10             : /// \brief Tests for transformations into normal form.
      11             : 
      12             : #include "mcrl2/bes/boolean_equation_system.h"
      13             : #include "mcrl2/bes/normal_forms.h"
      14             : #include "mcrl2/bes/parse.h"
      15             : #include "mcrl2/bes/print.h"
      16             : #include <boost/test/minimal.hpp>
      17             : #include <sstream>
      18             : #include <string>
      19             : 
      20             : using namespace mcrl2;
      21             : using namespace mcrl2::bes;
      22             : 
      23           4 : void test_standard_recursive_form(const std::string& bes_spec, bool recursive_form = false)
      24             : {
      25           8 :   boolean_equation_system b;
      26           8 :   std::stringstream from(bes_spec);
      27           4 :   from >> b;
      28           4 :   std::cout << "before\n" << bes::pp(b) << std::endl;
      29             : 
      30           4 :   make_standard_form(b, recursive_form);
      31           4 :   std::cout << "after\n" << bes::pp(b) << std::endl;
      32           4 : }
      33             : 
      34           1 : void test_standard_recursive_form()
      35             : {
      36             :   std::string bes1 =
      37             :     "pbes              \n"
      38             :     "                  \n"
      39             :     "nu X1 = X2 && X1; \n"
      40             :     "mu X2 = X1 || X2; \n"
      41             :     "                  \n"
      42           2 :     "init X1;          \n"
      43             :     ;
      44           1 :   test_standard_recursive_form(bes1, false);
      45           1 :   test_standard_recursive_form(bes1, true);
      46             : 
      47             :   std::string bes2 =
      48             :     "pbes                    \n"
      49             :     "                        \n"
      50             :     "nu X1 = X2 && true;     \n"
      51             :     "mu X2 = X1 || X2 && X1; \n"
      52             :     "                        \n"
      53           2 :     "init X1;                \n"
      54             :     ;
      55             : 
      56           1 :   test_standard_recursive_form(bes2, false);
      57           1 :   test_standard_recursive_form(bes2, true);
      58             : 
      59           1 : }
      60             : 
      61           1 : int test_main(int argc, char* argv[])
      62             : {
      63           1 :   test_standard_recursive_form();
      64             : 
      65           1 :   return 0;
      66           3 : }

Generated by: LCOV version 1.12