LCOV - code coverage report
Current view: top level - buildbot/coverage/build/test/unit/printer - print_enums.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 10 10 100.0 %
Date: 2026-04-24 10:45:42 Functions: 4 4 100.0 %
Branches: 14 14 100.0 %

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * This file is part of the cvc5 project.
       3                 :            :  *
       4                 :            :  * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS
       5                 :            :  * in the top-level source directory and their institutional affiliations.
       6                 :            :  * All rights reserved.  See the file COPYING in the top-level source
       7                 :            :  * directory for licensing information.
       8                 :            :  * ****************************************************************************
       9                 :            :  *
      10                 :            :  * Black box testing of printing enumerator types
      11                 :            :  */
      12                 :            : 
      13                 :            : #include <cvc5/cvc5.h>
      14                 :            : 
      15                 :            : #include <iostream>
      16                 :            : 
      17                 :            : #include "test_smt.h"
      18                 :            : #include "theory/arith/nl/strategy.h"
      19                 :            : #include "theory/arith/rewrites.h"
      20                 :            : #include "theory/ext_theory.h"
      21                 :            : #include "theory/incomplete_id.h"
      22                 :            : #include "theory/inference_id.h"
      23                 :            : #include "theory/strings/rewrites.h"
      24                 :            : #include "theory/strings/strategy.h"
      25                 :            : 
      26                 :            : using namespace cvc5::internal::theory;
      27                 :            : 
      28                 :            : namespace cvc5::internal {
      29                 :            : namespace test {
      30                 :            : 
      31                 :            : /**
      32                 :            :  * Set domain.optName to value due to reason. Notify if value changes.
      33                 :            :  */
      34                 :            : #define TEST_ENUM_RANGE(enumName, firstEnum, lastEnum) \
      35                 :            :   {                                                    \
      36                 :            :     size_t begin = static_cast<size_t>(firstEnum);     \
      37                 :            :     size_t end = static_cast<size_t>(lastEnum);        \
      38                 :            :     for (size_t i = begin; i < end; i++)               \
      39                 :            :     {                                                  \
      40                 :            :       out << static_cast<enumName>(i) << std::endl;    \
      41                 :            :     }                                                  \
      42                 :            :   }
      43                 :            : 
      44                 :            : class TestPrintEnums : public TestSmt
      45                 :            : {
      46                 :            : };
      47                 :            : 
      48                 :          4 : TEST_F(TestPrintEnums, print_enums)
      49                 :            : {
      50                 :          1 :   std::stringstream out;
      51         [ +  + ]:        413 :   TEST_ENUM_RANGE(InferenceId, InferenceId::NONE, InferenceId::UNKNOWN);
      52         [ +  + ]:         26 :   TEST_ENUM_RANGE(IncompleteId, IncompleteId::NONE, IncompleteId::UNKNOWN);
      53         [ +  + ]:         16 :   TEST_ENUM_RANGE(ExtReducedId, ExtReducedId::NONE, ExtReducedId::UNKNOWN);
      54         [ +  + ]:        203 :   TEST_ENUM_RANGE(
      55                 :            :       strings::Rewrite, strings::Rewrite::NONE, strings::Rewrite::UNKNOWN);
      56         [ +  + ]:         22 :   TEST_ENUM_RANGE(strings::InferStep,
      57                 :            :                   strings::InferStep::NONE,
      58                 :            :                   strings::InferStep::UNKNOWN);
      59         [ +  + ]:         17 :   TEST_ENUM_RANGE(
      60                 :            :       arith::Rewrite, arith::Rewrite::NONE, arith::Rewrite::UNKNOWN);
      61         [ +  + ]:         32 :   TEST_ENUM_RANGE(arith::nl::InferStep,
      62                 :            :                   arith::nl::InferStep::NONE,
      63                 :            :                   arith::nl::InferStep::UNKNOWN);
      64                 :          1 : }
      65                 :            : 
      66                 :            : }  // namespace test
      67                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14