OLD | NEW |
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 Loading... |
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 |
OLD | NEW |