• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_DISK_CACHE_BLOCKFILE_STRESS_SUPPORT_H_
6 #define NET_DISK_CACHE_BLOCKFILE_STRESS_SUPPORT_H_
7 
8 #include "base/check.h"
9 
10 namespace disk_cache {
11 
12 // Uncomment this line to generate a debug build of stress_cache with checks
13 // to ensure that we are not producing corrupt entries.
14 // #define NET_BUILD_STRESS_CACHE 1
15 
16 // Uncomment this line to perform extended integrity checks during init. It is
17 // not recommended to enable this option unless some corruption is being tracked
18 // down.
19 // #define STRESS_CACHE_EXTENDED_VALIDATION 1
20 
21 #if defined(NET_BUILD_STRESS_CACHE)
22 // Note that these may fail in the real world due to corruption, but we don't
23 // expect them to fire in stress tests. We use CHECK(false) instead of
24 // NOTREACHED() here since the latter is [[noreturn]] which we don't want here.
25 #define STRESS_NOTREACHED() CHECK(false)
26 #define STRESS_DCHECK(a) DCHECK(a)
27 #else
28 // We don't support streams with these macros, but that's a small price to pay
29 // to have a straightforward logic here. Please don't add something like
30 // LogMessageVoidify.
31 #define STRESS_NOTREACHED() {}
32 #define STRESS_DCHECK(a) {}
33 #endif
34 
35 }  // namespace disk_cache
36 
37 #endif  // NET_DISK_CACHE_BLOCKFILE_STRESS_SUPPORT_H_
38