Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: rlz/lib/assert.h

Issue 10642009: Add a regenerate button to regenerate the password in Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync and Merge. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « rlz/OWNERS ('k') | rlz/lib/assert.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Macros specific to the RLZ library.
6
7 #ifndef RLZ_LIB_ASSERT_H_
8 #define RLZ_LIB_ASSERT_H_
9
10 #include <string>
11 #include "base/logging.h"
12
13 // An assertion macro.
14 // Can mute expected assertions in debug mode.
15
16 #ifndef ASSERT_STRING
17 #ifndef MUTE_EXPECTED_ASSERTS
18 #define ASSERT_STRING(expr) LOG_IF(FATAL, false) << (expr)
19 #else
20 #define ASSERT_STRING(expr) \
21 do { \
22 std::string expr_string(expr); \
23 if (rlz_lib::expected_assertion_ != expr_string) { \
24 LOG_IF(FATAL, false) << (expr); \
25 } \
26 } while (0)
27 #endif
28 #endif
29
30
31 #ifndef VERIFY
32 #ifdef _DEBUG
33 #define VERIFY(expr) LOG_IF(FATAL, !(expr)) << #expr
34 #else
35 #define VERIFY(expr) (void)(expr)
36 #endif
37 #endif
38
39 namespace rlz_lib {
40
41 #ifdef MUTE_EXPECTED_ASSERTS
42 extern std::string expected_assertion_;
43 #endif
44
45 inline void SetExpectedAssertion(const char* s) {
46 #ifdef MUTE_EXPECTED_ASSERTS
47 expected_assertion_ = s;
48 #endif
49 }
50
51 } // rlz_lib
52
53 #endif // RLZ_LIB_ASSERT_H_
OLDNEW
« no previous file with comments | « rlz/OWNERS ('k') | rlz/lib/assert.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698