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

Side by Side Diff: runtime/vm/unit_test.h

Issue 13009004: Added EXPECT_TRUE macro, updated debugger unit tests to use it for (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/debugger_api_impl_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 VM_UNIT_TEST_H_ 5 #ifndef VM_UNIT_TEST_H_
6 #define VM_UNIT_TEST_H_ 6 #define VM_UNIT_TEST_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "vm/ast.h" 10 #include "vm/ast.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 if (Dart_IsError(tmp_handle)) { \ 353 if (Dart_IsError(tmp_handle)) { \
354 dart::Expect(__FILE__, __LINE__).IsSubstring((substring), \ 354 dart::Expect(__FILE__, __LINE__).IsSubstring((substring), \
355 Dart_GetError(tmp_handle)); \ 355 Dart_GetError(tmp_handle)); \
356 } else { \ 356 } else { \
357 dart::Expect(__FILE__, __LINE__).Fail( \ 357 dart::Expect(__FILE__, __LINE__).Fail( \
358 "expected '%s' to be an error handle but found a valid handle.\n", \ 358 "expected '%s' to be an error handle but found a valid handle.\n", \
359 #handle); \ 359 #handle); \
360 } \ 360 } \
361 } while (0) 361 } while (0)
362 362
363 #define EXPECT_TRUE(handle) \
364 do { \
365 Dart_Handle tmp_handle = (handle); \
366 if (Dart_IsBoolean(tmp_handle)) { \
367 bool value; \
368 Dart_BooleanValue(tmp_handle, &value); \
369 if (!value) { \
370 dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \
371 #handle); \
372 } \
373 } else { \
374 dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \
375 #handle); \
376 } \
377 } while (0)
378
363 } // namespace dart 379 } // namespace dart
364 380
365 #endif // VM_UNIT_TEST_H_ 381 #endif // VM_UNIT_TEST_H_
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698