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

Side by Side Diff: runtime/platform/assert.h

Issue 474033002: Ensure that hash for a symbol is not set to 0 when it is made external. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | runtime/vm/object.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef PLATFORM_ASSERT_H_ 5 #ifndef PLATFORM_ASSERT_H_
6 #define PLATFORM_ASSERT_H_ 6 #define PLATFORM_ASSERT_H_
7 7
8 // TODO(5411406): include sstream for now, once we have a Utils::toString() 8 // TODO(5411406): include sstream for now, once we have a Utils::toString()
9 // implemented for all the primitive types we can replace the usage of 9 // implemented for all the primitive types we can replace the usage of
10 // sstream by Utils::toString() 10 // sstream by Utils::toString()
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 // In order to avoid variable unused warnings for code that only uses 263 // In order to avoid variable unused warnings for code that only uses
264 // a variable in an ASSERT or EXPECT, we make sure to use the macro 264 // a variable in an ASSERT or EXPECT, we make sure to use the macro
265 // argument. 265 // argument.
266 #define ASSERT(condition) do {} while (false && (condition)) 266 #define ASSERT(condition) do {} while (false && (condition))
267 267
268 #define DEBUG_ASSERT(cond) 268 #define DEBUG_ASSERT(cond)
269 269
270 #endif // if defined(DEBUG) 270 #endif // if defined(DEBUG)
271 271
272 #define RELEASE_ASSERT(cond) \
273 do { \
274 if (!(cond)) dart::Assert(__FILE__, __LINE__).Fail("expected: %s", #cond); \
275 } while (false)
276
272 277
273 // The COMPILE_ASSERT macro can be used to verify that a compile time 278 // The COMPILE_ASSERT macro can be used to verify that a compile time
274 // expression is true. For example, you could use it to verify the 279 // expression is true. For example, you could use it to verify the
275 // size of a static array: 280 // size of a static array:
276 // 281 //
277 // COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES); 282 // COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES);
278 // 283 //
279 // or to make sure a struct is smaller than a certain size: 284 // or to make sure a struct is smaller than a certain size:
280 // 285 //
281 // COMPILE_ASSERT(sizeof(foo) < 128); 286 // COMPILE_ASSERT(sizeof(foo) < 128);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 348
344 #define FAIL1(format, p1) \ 349 #define FAIL1(format, p1) \
345 dart::Expect(__FILE__, __LINE__).Fail(format, (p1)) 350 dart::Expect(__FILE__, __LINE__).Fail(format, (p1))
346 351
347 #define FAIL2(format, p1, p2) \ 352 #define FAIL2(format, p1, p2) \
348 dart::Expect(__FILE__, __LINE__).Fail(format, (p1), (p2)) 353 dart::Expect(__FILE__, __LINE__).Fail(format, (p1), (p2))
349 354
350 #endif // defined(TESTING) 355 #endif // defined(TESTING)
351 356
352 #endif // PLATFORM_ASSERT_H_ 357 #endif // PLATFORM_ASSERT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698