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

Side by Side Diff: vm/object_test.cc

Issue 9481019: Changes to get rid of dependency on openssl in the dart VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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 | « vm/object.cc ('k') | vm/raw_object.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/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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 396 }
397 } 397 }
398 398
399 399
400 TEST_CASE(Bigint) { 400 TEST_CASE(Bigint) {
401 Bigint& b = Bigint::Handle(); 401 Bigint& b = Bigint::Handle();
402 EXPECT(b.IsNull()); 402 EXPECT(b.IsNull());
403 const String& test = String::Handle(String::New("1234")); 403 const String& test = String::Handle(String::New("1234"));
404 b = Bigint::New(test); 404 b = Bigint::New(test);
405 const char* str = b.ToCString(); 405 const char* str = b.ToCString();
406 EXPECT_STREQ("1234", str); 406 EXPECT_STREQ("0x4D2", str);
407 407
408 int64_t t64 = DART_2PART_UINT64_C(1, 0); 408 int64_t t64 = DART_2PART_UINT64_C(1, 0);
409 Bigint& big = Bigint::Handle(); 409 Bigint& big = Bigint::Handle();
410 big = BigintOperations::NewFromInt64(t64); 410 big = BigintOperations::NewFromInt64(t64);
411 EXPECT_EQ(t64, big.AsInt64Value()); 411 EXPECT_EQ(t64, big.AsInt64Value());
412 big = BigintOperations::NewFromCString("10000000000000000000"); 412 big = BigintOperations::NewFromCString("10000000000000000000");
413 EXPECT_EQ(1e19, big.AsDoubleValue()); 413 EXPECT_EQ(1e19, big.AsDoubleValue());
414 414
415 Bigint& big1 = Bigint::Handle(BigintOperations::NewFromCString( 415 Bigint& big1 = Bigint::Handle(BigintOperations::NewFromCString(
416 "100000000000000000000")); 416 "100000000000000000000"));
(...skipping 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 EXPECT_EQ(2, test_classes.length()); 2486 EXPECT_EQ(2, test_classes.length());
2487 EXPECT_EQ(smi_class.raw(), test_classes[0]->raw()); 2487 EXPECT_EQ(smi_class.raw(), test_classes[0]->raw());
2488 EXPECT_EQ(smi_class.raw(), test_classes[1]->raw()); 2488 EXPECT_EQ(smi_class.raw(), test_classes[1]->raw());
2489 EXPECT_EQ(target1.raw(), test_target.raw()); 2489 EXPECT_EQ(target1.raw(), test_target.raw());
2490 } 2490 }
2491 2491
2492 2492
2493 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 2493 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
2494 2494
2495 } // namespace dart 2495 } // namespace dart
OLDNEW
« no previous file with comments | « vm/object.cc ('k') | vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698