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

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