LCOV - code coverage report
Current view: top level - buildbot/coverage/build/test/api/cpp/issues - proj-issue379.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 26 26 100.0 %
Date: 2026-02-20 12:02:05 Functions: 1 1 100.0 %
Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * Top contributors (to current version):
       3                 :            :  *   Aina Niemetz, Andrew Reynolds, Mathias Preiner
       4                 :            :  *
       5                 :            :  * This file is part of the cvc5 project.
       6                 :            :  *
       7                 :            :  * Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
       8                 :            :  * in the top-level source directory and their institutional affiliations.
       9                 :            :  * All rights reserved.  See the file COPYING in the top-level source
      10                 :            :  * directory for licensing information.
      11                 :            :  * ****************************************************************************
      12                 :            :  *
      13                 :            :  * Test for project issue #379.
      14                 :            :  */
      15                 :            : #include <cvc5/cvc5.h>
      16                 :            : 
      17                 :            : #include <cassert>
      18                 :            : 
      19                 :            : using namespace cvc5;
      20                 :            : 
      21                 :          1 : int main(void)
      22                 :            : {
      23                 :          1 :   TermManager tm;
      24                 :            : 
      25                 :          1 :   Sort bsort = tm.getBooleanSort();
      26                 :          1 :   Sort psort = tm.mkParamSort("_x1");
      27                 :          1 :   DatatypeConstructorDecl cdecl;
      28                 :          3 :   DatatypeDecl dtdecl = tm.mkDatatypeDecl("x_0", {psort});
      29                 :          1 :   cdecl = tm.mkDatatypeConstructorDecl("_x8");
      30                 :          1 :   cdecl.addSelector("_x7", bsort);
      31                 :          1 :   dtdecl.addConstructor(cdecl);
      32                 :          1 :   cdecl = tm.mkDatatypeConstructorDecl("_x6");
      33                 :          1 :   cdecl.addSelector("_x2", psort);
      34                 :          1 :   cdecl.addSelectorSelf("_x3");
      35                 :          1 :   cdecl.addSelector("_x4", psort);
      36                 :          1 :   cdecl.addSelector("_x5", bsort);
      37                 :          1 :   Sort s2 = tm.mkDatatypeSort(dtdecl);
      38                 :          3 :   Sort s6 = s2.instantiate({bsort});
      39                 :          1 :   Term t317 = tm.mkConst(bsort, "_x345");
      40                 :          1 :   Term t843 = tm.mkConst(s6, "_x346");
      41                 :          3 :   Term t879 = tm.mkTerm(Kind::APPLY_UPDATER,
      42                 :          1 :                         {t843.getSort()
      43                 :          2 :                              .getDatatype()
      44                 :          2 :                              .getConstructor("_x8")
      45                 :          2 :                              .getSelector("_x7")
      46                 :            :                              .getUpdaterTerm(),
      47                 :            :                          t843,
      48                 :          3 :                          t317});
      49         [ -  + ]:          1 :   assert(t879.getSort() == s6);
      50                 :          1 : }

Generated by: LCOV version 1.14