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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 | 119 |
120 // Helper function used by the CHECK function when given string | 120 // Helper function used by the CHECK function when given string |
121 // arguments. Should not be called directly. | 121 // arguments. Should not be called directly. |
122 static inline void CheckEqualsHelper(const char* file, | 122 static inline void CheckEqualsHelper(const char* file, |
123 int line, | 123 int line, |
124 const char* expected_source, | 124 const char* expected_source, |
125 const char* expected, | 125 const char* expected, |
126 const char* value_source, | 126 const char* value_source, |
127 const char* value) { | 127 const char* value) { |
128 if (strcmp(expected, value) != 0) { | 128 if ((expected == NULL && value != NULL) || |
| 129 (expected != NULL && value == NULL) || |
| 130 (expected != NULL && value != NULL && strcmp(expected, value) != 0)) { |
129 V8_Fatal(file, line, | 131 V8_Fatal(file, line, |
130 "CHECK_EQ(%s, %s) failed\n# Expected: %s\n# Found: %s", | 132 "CHECK_EQ(%s, %s) failed\n# Expected: %s\n# Found: %s", |
131 expected_source, value_source, expected, value); | 133 expected_source, value_source, expected, value); |
132 } | 134 } |
133 } | 135 } |
134 | 136 |
135 | 137 |
136 static inline void CheckNonEqualsHelper(const char* file, | 138 static inline void CheckNonEqualsHelper(const char* file, |
137 int line, | 139 int line, |
138 const char* expected_source, | 140 const char* expected_source, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 277 |
276 | 278 |
277 #define ASSERT_TAG_ALIGNED(address) \ | 279 #define ASSERT_TAG_ALIGNED(address) \ |
278 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) | 280 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) |
279 | 281 |
280 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) | 282 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) |
281 | 283 |
282 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 284 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
283 | 285 |
284 #endif // V8_CHECKS_H_ | 286 #endif // V8_CHECKS_H_ |
OLD | NEW |