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

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

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/assembler.cc ('k') | runtime/vm/bit_vector.h » ('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 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/bigint_operations.h" 6 #include "vm/bigint_operations.h"
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/object_store.h" 8 #include "vm/object_store.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 static uword ZoneAllocator(intptr_t size) { 13 static uword ZoneAllocator(intptr_t size) {
14 Zone* zone = Isolate::Current()->current_zone(); 14 Zone* zone = Isolate::Current()->current_zone();
15 return zone->Allocate(size); 15 return zone->AllocUnsafe(size);
16 } 16 }
17 17
18 18
19 TEST_CASE(BigintSmi) { 19 TEST_CASE(BigintSmi) {
20 { 20 {
21 const Smi& smi = Smi::Handle(Smi::New(5)); 21 const Smi& smi = Smi::Handle(Smi::New(5));
22 const Bigint& bigint = Bigint::Handle(BigintOperations::NewFromSmi(smi)); 22 const Bigint& bigint = Bigint::Handle(BigintOperations::NewFromSmi(smi));
23 EXPECT(BigintOperations::FitsIntoSmi(bigint)); 23 EXPECT(BigintOperations::FitsIntoSmi(bigint));
24 const Smi& smi_back = Smi::Handle(BigintOperations::ToSmi(bigint)); 24 const Smi& smi_back = Smi::Handle(BigintOperations::ToSmi(bigint));
25 EXPECT_EQ(5, smi_back.Value()); 25 EXPECT_EQ(5, smi_back.Value());
(...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 "123456789012345678901234567890123456789012345678901234567890123456789012" 2225 "123456789012345678901234567890123456789012345678901234567890123456789012"
2226 "345678901234567890123456789012345678901234567890123456789012345678901234" 2226 "345678901234567890123456789012345678901234567890123456789012345678901234"
2227 "567890123456789012345678901234567890123456789012345678901234567890123456" 2227 "567890123456789012345678901234567890123456789012345678901234567890123456"
2228 "789012345678901234567890123456789012345678901234567890123456789012345678" 2228 "789012345678901234567890123456789012345678901234567890123456789012345678"
2229 "90123456789012345678901234567890", 2229 "90123456789012345678901234567890",
2230 "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF" 2230 "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
2231 "01234567890ABCDEE"); 2231 "01234567890ABCDEE");
2232 } 2232 }
2233 2233
2234 } // namespace dart 2234 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler.cc ('k') | runtime/vm/bit_vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698