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

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

Issue 9363018: Add integer min/max constants to globals.h (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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/dart_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) 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" 5 #include "platform/assert.h"
6 #include "vm/assembler.h" 6 #include "vm/assembler.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 EXPECT(smi.Equals(Smi::Handle(Smi::New(5)))); 216 EXPECT(smi.Equals(Smi::Handle(Smi::New(5))));
217 EXPECT(!smi.Equals(Smi::Handle(Smi::New(6)))); 217 EXPECT(!smi.Equals(Smi::Handle(Smi::New(6))));
218 EXPECT(smi.Equals(smi)); 218 EXPECT(smi.Equals(smi));
219 EXPECT(!smi.Equals(Smi::Handle())); 219 EXPECT(!smi.Equals(Smi::Handle()));
220 220
221 EXPECT(Smi::IsValid(0)); 221 EXPECT(Smi::IsValid(0));
222 EXPECT(Smi::IsValid(-15)); 222 EXPECT(Smi::IsValid(-15));
223 // Upper two bits must be either 00 or 11. 223 // Upper two bits must be either 00 or 11.
224 #if defined(ARCH_IS_64_BIT) 224 #if defined(ARCH_IS_64_BIT)
225 EXPECT(!Smi::IsValid(0x7FFFFFFFFFFFFFFF)); 225 EXPECT(!Smi::IsValid(kMaxInt64));
226 EXPECT(Smi::IsValid(0x3FFFFFFFFFFFFFFF)); 226 EXPECT(Smi::IsValid(0x3FFFFFFFFFFFFFFF));
227 EXPECT(Smi::IsValid(0xFFFFFFFFFFFFFFFF)); 227 EXPECT(Smi::IsValid(0xFFFFFFFFFFFFFFFF));
228 #else 228 #else
229 EXPECT(!Smi::IsValid(0x7FFFFFFF)); 229 EXPECT(!Smi::IsValid(kMaxInt32));
230 EXPECT(Smi::IsValid(0x3FFFFFFF)); 230 EXPECT(Smi::IsValid(0x3FFFFFFF));
231 EXPECT(Smi::IsValid(0xFFFFFFFF)); 231 EXPECT(Smi::IsValid(0xFFFFFFFF));
232 #endif 232 #endif
233 233
234 EXPECT_EQ(5, smi.AsInt64Value()); 234 EXPECT_EQ(5, smi.AsInt64Value());
235 EXPECT_EQ(5.0, smi.AsDoubleValue()); 235 EXPECT_EQ(5.0, smi.AsDoubleValue());
236 236
237 Smi& a = Smi::Handle(Smi::New(5)); 237 Smi& a = Smi::Handle(Smi::New(5));
238 Smi& b = Smi::Handle(Smi::New(3)); 238 Smi& b = Smi::Handle(Smi::New(3));
239 EXPECT_EQ(1, a.CompareWith(b)); 239 EXPECT_EQ(1, a.CompareWith(b));
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2389 cls = iterator.GetNextClass(); 2389 cls = iterator.GetNextClass();
2390 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); 2390 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw()));
2391 count++; 2391 count++;
2392 } 2392 }
2393 ASSERT(count == 2); 2393 ASSERT(count == 2);
2394 } 2394 }
2395 2395
2396 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 2396 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
2397 2397
2398 } // namespace dart 2398 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698