LCOV - code coverage report
Current view: top level - buildbot/coverage/build/test/unit/context - cdhashmap_white.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 9 9 100.0 %
Date: 2026-09-19 09:47:20 Functions: 4 4 100.0 %
Branches: 4 10 40.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                 :            :  * White box testing of cvc5::context::CDMap<>.
      11                 :            :  */
      12                 :            : 
      13                 :            : #include "base/check.h"
      14                 :            : #include "context/cdhashmap.h"
      15                 :            : #include "test_context.h"
      16                 :            : 
      17                 :            : namespace cvc5::internal {
      18                 :            : 
      19                 :            : using namespace context;
      20                 :            : 
      21                 :            : namespace test {
      22                 :            : 
      23                 :            : class TestContextWhiteCDHashMap : public TestContext
      24                 :            : {
      25                 :            : };
      26                 :            : 
      27                 :          4 : TEST_F(TestContextWhiteCDHashMap, unreachable_save_and_restore)
      28                 :            : {
      29                 :          1 :   CDHashMap<int, int> map(d_context.get());
      30                 :            : 
      31 [ +  - ][ +  - ]:          1 :   ASSERT_NO_THROW(map.makeCurrent());
         [ +  - ][ -  - ]
      32                 :            : 
      33                 :          1 :   ASSERT_DEATH(map.update(), "Unreachable code reached");
      34                 :            : 
      35                 :          1 :   ASSERT_DEATH(map.save(d_context->getCMM()), "Unreachable code reached");
      36                 :          1 :   ASSERT_DEATH(map.restore(&map), "Unreachable code reached");
      37                 :            : 
      38                 :          1 :   d_context->push();
      39                 :          1 :   ASSERT_DEATH(map.makeCurrent(), "Unreachable code reached");
      40         [ +  - ]:          1 : }
      41                 :            : 
      42                 :            : }  // namespace test
      43                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14