| OLD | NEW |
| 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 #include "platform/assert.h" |
| 6 |
| 5 #include <cstdlib> | 7 #include <cstdlib> |
| 6 #include <sstream> | 8 #include <sstream> |
| 7 #include <string> | 9 #include <string> |
| 8 | 10 |
| 9 #include "platform/assert.h" | |
| 10 #include "platform/globals.h" | 11 #include "platform/globals.h" |
| 11 | 12 |
| 12 namespace dart { | 13 namespace dart { |
| 13 | 14 |
| 14 // Exit with a failure code when we miss an EXPECT check. | 15 // Exit with a failure code when we miss an EXPECT check. |
| 15 static void failed_exit(void) { | 16 static void failed_exit(void) { |
| 16 exit(255); | 17 exit(255); |
| 17 } | 18 } |
| 18 | 19 |
| 19 void DynamicAssertionHelper::Fail(const char* format, ...) { | 20 void DynamicAssertionHelper::Fail(const char* format, ...) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 std::abort(); | 41 std::abort(); |
| 41 } | 42 } |
| 42 static bool failed = false; | 43 static bool failed = false; |
| 43 if (!failed) { | 44 if (!failed) { |
| 44 std::atexit(&failed_exit); | 45 std::atexit(&failed_exit); |
| 45 } | 46 } |
| 46 failed = true; | 47 failed = true; |
| 47 } | 48 } |
| 48 | 49 |
| 49 } // namespace dart | 50 } // namespace dart |
| OLD | NEW |