GCC Code Coverage Report
Directory: . Exec Total Coverage
File: test/unit/context/cdhashmap_white.cpp Lines: 10 10 100.0 %
Date: 2021-09-18 Branches: 66 264 25.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Aina Niemetz
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 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
 * White box testing of cvc5::context::CDMap<>.
14
 */
15
16
#include "base/check.h"
17
#include "context/cdhashmap.h"
18
#include "test_context.h"
19
20
namespace cvc5 {
21
22
using namespace context;
23
24
namespace test {
25
26
4
class TestContextWhiteCDHashMap : public TestContext
27
{
28
};
29
30
10
TEST_F(TestContextWhiteCDHashMap, unreachable_save_and_restore)
31
{
32
4
  CDHashMap<int, int> map(d_context.get());
33
34
2
  ASSERT_NO_THROW(map.makeCurrent());
35
36
2
  ASSERT_DEATH(map.update(), "Unreachable code reached");
37
38
2
  ASSERT_DEATH(map.save(d_context->getCMM()), "Unreachable code reached");
39
2
  ASSERT_DEATH(map.restore(&map), "Unreachable code reached");
40
41
2
  d_context->push();
42
2
  ASSERT_DEATH(map.makeCurrent(), "Unreachable code reached");
43
}
44
45
}  // namespace test
46
6
}  // namespace cvc5