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

Side by Side Diff: runtime/vm/object_test.cc

Issue 317643004: Unify handling of identical(NaN, NaN) between generated code and Dart API. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/object.cc ('k') | tests/language/number_identity2_test.dart » ('j') | 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) 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 // TODO(zra): Remove when tests are ready to enable. 5 // TODO(zra): Remove when tests are ready to enable.
6 #include "platform/globals.h" 6 #include "platform/globals.h"
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 EXPECT(dbl1.IsIdenticalTo(dbl2)); 520 EXPECT(dbl1.IsIdenticalTo(dbl2));
521 EXPECT(dbl1.CanonicalizeEquals(dbl2)); 521 EXPECT(dbl1.CanonicalizeEquals(dbl2));
522 const Double& dbl3 = Double::Handle(Double::New(3.3)); 522 const Double& dbl3 = Double::Handle(Double::New(3.3));
523 EXPECT(!dbl1.OperatorEquals(dbl3)); 523 EXPECT(!dbl1.OperatorEquals(dbl3));
524 EXPECT(!dbl1.OperatorEquals(Smi::Handle(Smi::New(3)))); 524 EXPECT(!dbl1.OperatorEquals(Smi::Handle(Smi::New(3))));
525 EXPECT(!dbl1.OperatorEquals(Double::Handle())); 525 EXPECT(!dbl1.OperatorEquals(Double::Handle()));
526 const Double& nan0 = Double::Handle(Double::New(NAN)); 526 const Double& nan0 = Double::Handle(Double::New(NAN));
527 EXPECT(nan0.IsIdenticalTo(nan0)); 527 EXPECT(nan0.IsIdenticalTo(nan0));
528 EXPECT(nan0.CanonicalizeEquals(nan0)); 528 EXPECT(nan0.CanonicalizeEquals(nan0));
529 EXPECT(!nan0.OperatorEquals(nan0)); 529 EXPECT(!nan0.OperatorEquals(nan0));
530 // TODO(18738): Test bitwise different NaNs after agreement on spec. 530 const Double& nan1 = Double::Handle(Double::New(0.0/0.0));
531 const Double& nan2 = Double::Handle(Double::New(1.0/0.0));
koda 2014/06/06 23:26:29 Doesn't 1.0/0.0 give you positive infinity? It se
regis 2014/06/06 23:51:56 Yes, thank you, 1.0/0.0 is infinity, but not a NaN
532 EXPECT(!nan1.IsIdenticalTo(nan2));
533 EXPECT(!nan1.CanonicalizeEquals(nan2));
534 EXPECT(!nan1.OperatorEquals(nan2));
531 } 535 }
532 { 536 {
533 const String& dbl_str0 = String::Handle(String::New("bla")); 537 const String& dbl_str0 = String::Handle(String::New("bla"));
534 const Double& dbl0 = Double::Handle(Double::New(dbl_str0)); 538 const Double& dbl0 = Double::Handle(Double::New(dbl_str0));
535 EXPECT(dbl0.IsNull()); 539 EXPECT(dbl0.IsNull());
536 540
537 const String& dbl_str1 = String::Handle(String::New("2.0")); 541 const String& dbl_str1 = String::Handle(String::New("2.0"));
538 const Double& dbl1 = Double::Handle(Double::New(dbl_str1)); 542 const Double& dbl1 = Double::Handle(Double::New(dbl_str1));
539 EXPECT_EQ(2.0, dbl1.value()); 543 EXPECT_EQ(2.0, dbl1.value());
540 544
(...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after
4044 const Instance& a0 = Instance::Handle(Instance::New(clazz)); 4048 const Instance& a0 = Instance::Handle(Instance::New(clazz));
4045 const Instance& a1 = Instance::Handle(Instance::New(clazz)); 4049 const Instance& a1 = Instance::Handle(Instance::New(clazz));
4046 EXPECT(a0.raw() != a1.raw()); 4050 EXPECT(a0.raw() != a1.raw());
4047 EXPECT(a0.OperatorEquals(a0)); 4051 EXPECT(a0.OperatorEquals(a0));
4048 EXPECT(a0.OperatorEquals(a1)); 4052 EXPECT(a0.OperatorEquals(a1));
4049 EXPECT(a0.IsIdenticalTo(a0)); 4053 EXPECT(a0.IsIdenticalTo(a0));
4050 EXPECT(!a0.IsIdenticalTo(a1)); 4054 EXPECT(!a0.IsIdenticalTo(a1));
4051 } 4055 }
4052 4056
4053 } // namespace dart 4057 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/number_identity2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698