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

Unified Diff: vm/unit_test.h

Issue 10115034: Add a missing arity check for top-level methods in Dart_Invoke. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/unit_test.h
===================================================================
--- vm/unit_test.h (revision 6699)
+++ vm/unit_test.h (working copy)
@@ -278,12 +278,30 @@
static bool TestCompileFunction(const Function& function);
};
-#define EXPECT_VALID(handle) \
- if (Dart_IsError((handle))) { \
- dart::Expect(__FILE__, __LINE__).Fail("invalid handle '%s':\n '%s'\n", \
- #handle, Dart_GetError(handle)); \
- }
+#define EXPECT_VALID(handle) \
+ do { \
+ Dart_Handle tmp_handle = (handle); \
+ if (Dart_IsError(tmp_handle)) { \
+ dart::Expect(__FILE__, __LINE__).Fail( \
+ "expected '%s' to be a valid handle but found an error handle:\n" \
+ " '%s'\n", \
+ #handle, Dart_GetError(tmp_handle)); \
+ } \
+ } while (0)
+#define EXPECT_ERROR(handle, substring) \
+ do { \
+ Dart_Handle tmp_handle = (handle); \
+ if (Dart_IsError(tmp_handle)) { \
+ dart::Expect(__FILE__, __LINE__).IsSubstring((substring), \
+ Dart_GetError(tmp_handle)); \
+ } else { \
+ dart::Expect(__FILE__, __LINE__).Fail( \
+ "expected '%s' to be an error handle but found a valid handle.\n", \
+ #handle); \
+ } \
+ } while (0)
+
} // namespace dart
#endif // VM_UNIT_TEST_H_
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698