| Kea 3.0.2-git

check_valgrind.h
Go to the documentation of this file.
1// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7//
8// If we have the valgrind headers available, we can detect whether
9// valgrind is running. This should normally never be done, as you
10// want the to test the actual code in operation with valgrind.
11//
12// However, there is a limited set of operations where we want to
13// skip some tests if run under valgrind, most notably the
14// EXPECT_DEATH tests, as these would report memory leaks by
15// definition.
16//
17// If the valgrind headers are NOT available, the method checkValgrind()
18// always returns false; i.e. it always pretends the program is run
19// natively
20//
21
22#ifndef UTIL_UNITTESTS_CHECK_VALGRIND_H
23#define UTIL_UNITTESTS_CHECK_VALGRIND_H 1
24
25 namespace isc {
26 namespace util {
27 namespace unittests {
28
39 bool runningOnValgrind();
40
41} // end namespace unittests
42} // end namespace util
43} // end namespace isc
44
45#endif // UTIL_UNITTESTS_CHECK_VALGRIND_H
isc::util::unittests
Definition check_valgrind.cc:11
isc::util::unittests::runningOnValgrind
bool runningOnValgrind()
Check if the program is run in valgrind.
Definition check_valgrind.cc:26
isc::util
Definition time_utils.cc:43
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148