OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 (void)0) | 205 (void)0) |
206 | 206 |
207 #define ASSERT_AT(assertion, file, line, function) \ | 207 #define ASSERT_AT(assertion, file, line, function) \ |
208 (!(assertion) ? \ | 208 (!(assertion) ? \ |
209 (WTFReportAssertionFailure(file, line, function, #assertion), \ | 209 (WTFReportAssertionFailure(file, line, function, #assertion), \ |
210 CRASH()) : \ | 210 CRASH()) : \ |
211 (void)0) | 211 (void)0) |
212 | 212 |
213 #define ASSERT_NOT_REACHED() do { \ | 213 #define ASSERT_NOT_REACHED() do { \ |
214 WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, 0); \ | 214 WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, 0); \ |
215 CRASH(); \ | 215 /*CRASH();*/ \ |
216 } while (0) | 216 } while (0) |
217 | 217 |
218 #define ASSERT_UNUSED(variable, assertion) ASSERT(assertion) | 218 #define ASSERT_UNUSED(variable, assertion) ASSERT(assertion) |
219 | 219 |
220 #define NO_RETURN_DUE_TO_ASSERT NO_RETURN_DUE_TO_CRASH | 220 #define NO_RETURN_DUE_TO_ASSERT NO_RETURN_DUE_TO_CRASH |
221 | 221 |
222 #else | 222 #else |
223 | 223 |
224 #define ASSERT(assertion) ((void)0) | 224 #define ASSERT(assertion) ((void)0) |
225 #define ASSERT_AT(assertion, file, line, function) ((void)0) | 225 #define ASSERT_AT(assertion, file, line, function) ((void)0) |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 } \ | 417 } \ |
418 inline const thisType& to##thisType(const argumentType& argumentName) \ | 418 inline const thisType& to##thisType(const argumentType& argumentName) \ |
419 { \ | 419 { \ |
420 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 420 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
421 return static_cast<const thisType&>(argumentName); \ | 421 return static_cast<const thisType&>(argumentName); \ |
422 } \ | 422 } \ |
423 void to##thisType(const thisType*); \ | 423 void to##thisType(const thisType*); \ |
424 void to##thisType(const thisType&) | 424 void to##thisType(const thisType&) |
425 | 425 |
426 #endif /* WTF_Assertions_h */ | 426 #endif /* WTF_Assertions_h */ |
OLD | NEW |