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

Side by Side Diff: third_party/tcmalloc/chromium/src/base/logging.h

Issue 576001: Merged third_party/tcmalloc/vendor/src(google-perftools r87) into... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removed the unnecessary printf and ASSERT(0) Created 10 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } \ 129 } \
130 } while (0) 130 } while (0)
131 131
132 #define CHECK_EQ(val1, val2) CHECK_OP(==, val1, val2) 132 #define CHECK_EQ(val1, val2) CHECK_OP(==, val1, val2)
133 #define CHECK_NE(val1, val2) CHECK_OP(!=, val1, val2) 133 #define CHECK_NE(val1, val2) CHECK_OP(!=, val1, val2)
134 #define CHECK_LE(val1, val2) CHECK_OP(<=, val1, val2) 134 #define CHECK_LE(val1, val2) CHECK_OP(<=, val1, val2)
135 #define CHECK_LT(val1, val2) CHECK_OP(< , val1, val2) 135 #define CHECK_LT(val1, val2) CHECK_OP(< , val1, val2)
136 #define CHECK_GE(val1, val2) CHECK_OP(>=, val1, val2) 136 #define CHECK_GE(val1, val2) CHECK_OP(>=, val1, val2)
137 #define CHECK_GT(val1, val2) CHECK_OP(> , val1, val2) 137 #define CHECK_GT(val1, val2) CHECK_OP(> , val1, val2)
138 138
139 // A synonym for CHECK_* that is used in some unittests. 139 // Synonyms for CHECK_* that are used in some unittests.
140 #define EXPECT_EQ(val1, val2) CHECK_EQ(val1, val2) 140 #define EXPECT_EQ(val1, val2) CHECK_EQ(val1, val2)
141 #define EXPECT_NE(val1, val2) CHECK_NE(val1, val2) 141 #define EXPECT_NE(val1, val2) CHECK_NE(val1, val2)
142 #define EXPECT_LE(val1, val2) CHECK_LE(val1, val2) 142 #define EXPECT_LE(val1, val2) CHECK_LE(val1, val2)
143 #define EXPECT_LT(val1, val2) CHECK_LT(val1, val2) 143 #define EXPECT_LT(val1, val2) CHECK_LT(val1, val2)
144 #define EXPECT_GE(val1, val2) CHECK_GE(val1, val2) 144 #define EXPECT_GE(val1, val2) CHECK_GE(val1, val2)
145 #define EXPECT_GT(val1, val2) CHECK_GT(val1, val2) 145 #define EXPECT_GT(val1, val2) CHECK_GT(val1, val2)
146 #define ASSERT_EQ(val1, val2) EXPECT_EQ(val1, val2)
147 #define ASSERT_NE(val1, val2) EXPECT_NE(val1, val2)
148 #define ASSERT_LE(val1, val2) EXPECT_LE(val1, val2)
149 #define ASSERT_LT(val1, val2) EXPECT_LT(val1, val2)
150 #define ASSERT_GE(val1, val2) EXPECT_GE(val1, val2)
151 #define ASSERT_GT(val1, val2) EXPECT_GT(val1, val2)
146 // As are these variants. 152 // As are these variants.
147 #define EXPECT_TRUE(cond) CHECK(cond) 153 #define EXPECT_TRUE(cond) CHECK(cond)
148 #define EXPECT_FALSE(cond) CHECK(!(cond)) 154 #define EXPECT_FALSE(cond) CHECK(!(cond))
149 #define EXPECT_STREQ(a, b) CHECK(strcmp(a, b) == 0) 155 #define EXPECT_STREQ(a, b) CHECK(strcmp(a, b) == 0)
156 #define ASSERT_TRUE(cond) EXPECT_TRUE(cond)
157 #define ASSERT_FALSE(cond) EXPECT_FALSE(cond)
158 #define ASSERT_STREQ(a, b) EXPECT_STREQ(a, b)
150 159
151 // Used for (libc) functions that return -1 and set errno 160 // Used for (libc) functions that return -1 and set errno
152 #define CHECK_ERR(invocation) PCHECK((invocation) != -1) 161 #define CHECK_ERR(invocation) PCHECK((invocation) != -1)
153 162
154 // A few more checks that only happen in debug mode 163 // A few more checks that only happen in debug mode
155 #ifdef NDEBUG 164 #ifdef NDEBUG
156 #define DCHECK_EQ(val1, val2) 165 #define DCHECK_EQ(val1, val2)
157 #define DCHECK_NE(val1, val2) 166 #define DCHECK_NE(val1, val2)
158 #define DCHECK_LE(val1, val2) 167 #define DCHECK_LE(val1, val2)
159 #define DCHECK_LT(val1, val2) 168 #define DCHECK_LT(val1, val2)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 #else 236 #else
228 typedef int RawFD; 237 typedef int RawFD;
229 const RawFD kIllegalRawFD = -1; // what open returns if it fails 238 const RawFD kIllegalRawFD = -1; // what open returns if it fails
230 #endif // defined(_WIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__) 239 #endif // defined(_WIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__)
231 240
232 RawFD RawOpenForWriting(const char* filename); // uses default permissions 241 RawFD RawOpenForWriting(const char* filename); // uses default permissions
233 void RawWrite(RawFD fd, const char* buf, size_t len); 242 void RawWrite(RawFD fd, const char* buf, size_t len);
234 void RawClose(RawFD fd); 243 void RawClose(RawFD fd);
235 244
236 #endif // _LOGGING_H_ 245 #endif // _LOGGING_H_
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/dynamic_annotations.h ('k') | third_party/tcmalloc/chromium/src/base/low_level_alloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698