OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 #define CHECK(condition) CheckHelper(__FILE__, __LINE__, #condition, condition) | 66 #define CHECK(condition) CheckHelper(__FILE__, __LINE__, #condition, condition) |
67 | 67 |
68 | 68 |
69 // Helper function used by the CHECK_EQ function when given int | 69 // Helper function used by the CHECK_EQ function when given int |
70 // arguments. Should not be called directly. | 70 // arguments. Should not be called directly. |
71 static inline void CheckEqualsHelper(const char* file, int line, | 71 static inline void CheckEqualsHelper(const char* file, int line, |
72 const char* expected_source, int expected, | 72 const char* expected_source, int expected, |
73 const char* value_source, int value) { | 73 const char* value_source, int value) { |
74 if (expected != value) { | 74 if (expected != value) { |
75 V8_Fatal(file, line, | 75 V8_Fatal(file, line, |
76 "CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i", | 76 "CHECK_EQ(%s, %s) failed\n" |
Søren Thygesen Gjesse
2011/02/03 09:07:17
I don't think we want tabs in the output.
Rodolph Perfetta
2011/02/03 15:03:39
Done.
| |
77 expected_source, value_source, expected, value); | 77 "#\tExpected: %i\t(0x%x)\n#\tFound: %i\t(0x%x)", |
78 expected_source, value_source, expected, expected, value, value); | |
78 } | 79 } |
79 } | 80 } |
80 | 81 |
81 | 82 |
82 // Helper function used by the CHECK_EQ function when given int64_t | 83 // Helper function used by the CHECK_EQ function when given int64_t |
83 // arguments. Should not be called directly. | 84 // arguments. Should not be called directly. |
84 static inline void CheckEqualsHelper(const char* file, int line, | 85 static inline void CheckEqualsHelper(const char* file, int line, |
85 const char* expected_source, | 86 const char* expected_source, |
86 int64_t expected, | 87 int64_t expected, |
87 const char* value_source, | 88 const char* value_source, |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 // Static asserts has no impact on runtime performance, so they can be | 284 // Static asserts has no impact on runtime performance, so they can be |
284 // safely enabled in release mode. Moreover, the ((void) 0) expression | 285 // safely enabled in release mode. Moreover, the ((void) 0) expression |
285 // obeys different syntax rules than typedef's, e.g. it can't appear | 286 // obeys different syntax rules than typedef's, e.g. it can't appear |
286 // inside class declaration, this leads to inconsistency between debug | 287 // inside class declaration, this leads to inconsistency between debug |
287 // and release compilation modes behavior. | 288 // and release compilation modes behavior. |
288 #define STATIC_ASSERT(test) STATIC_CHECK(test) | 289 #define STATIC_ASSERT(test) STATIC_CHECK(test) |
289 | 290 |
290 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 291 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
291 | 292 |
292 #endif // V8_CHECKS_H_ | 293 #endif // V8_CHECKS_H_ |
OLD | NEW |