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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 24254004: Make Dart_IdentityEqual live up to its sepc and not leak boxing implementation detail. (Reland r275… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debug prints Created 7 years, 3 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 | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index f953ef2f3c58c395c1313ca10b43cc906b2135cf..b043969d1ed5a2204b08009b48c10f45bb943940 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -201,6 +201,11 @@ TEST_CASE(IdentityEquals) {
// Different objects.
EXPECT(!Dart_IdentityEquals(five, seven));
+ // Case where identical() is not the same as pointer equality.
+ Dart_Handle nan1 = Dart_NewDouble(NAN);
+ Dart_Handle nan2 = Dart_NewDouble(NAN);
+ EXPECT(Dart_IdentityEquals(nan1, nan2));
+
// Non-instance objects.
{
Isolate* isolate = Isolate::Current();
@@ -211,6 +216,10 @@ TEST_CASE(IdentityEquals) {
EXPECT(Dart_IdentityEquals(lib1, lib1));
EXPECT(Dart_IdentityEquals(lib2, lib2));
EXPECT(!Dart_IdentityEquals(lib1, lib2));
+
+ // Mix instance and non-instance.
+ EXPECT(!Dart_IdentityEquals(lib1, nan1));
+ EXPECT(!Dart_IdentityEquals(nan1, lib1));
}
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698