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

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

Issue 11414211: Expose transferable constructor to Int8List (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fixes Created 8 years 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
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 "platform/utils.h" 6 #include "platform/utils.h"
7 #include "vm/globals.h" 7 #include "vm/globals.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 48
49 UNIT_TEST_CASE(OsFuncs) { 49 UNIT_TEST_CASE(OsFuncs) {
50 EXPECT(Utils::IsPowerOfTwo(OS::ActivationFrameAlignment())); 50 EXPECT(Utils::IsPowerOfTwo(OS::ActivationFrameAlignment()));
51 EXPECT(Utils::IsPowerOfTwo(OS::PreferredCodeAlignment())); 51 EXPECT(Utils::IsPowerOfTwo(OS::PreferredCodeAlignment()));
52 int procs = OS::NumberOfAvailableProcessors(); 52 int procs = OS::NumberOfAvailableProcessors();
53 EXPECT_LE(1, procs); 53 EXPECT_LE(1, procs);
54 EXPECT_LT(0U, OS::GetStackSizeLimit()); 54 EXPECT_LT(0U, OS::GetStackSizeLimit());
55 } 55 }
56 56
57 UNIT_TEST_CASE(OSAlignedAllocate) {
58 void* p16 = OS::AlignedAllocate(1023, 16);
59 void* p32 = OS::AlignedAllocate(1025, 32);
60 void* p64 = OS::AlignedAllocate(1025, 64);
61 EXPECT((reinterpret_cast<intptr_t>(p16) & 15) == 0);
62 EXPECT((reinterpret_cast<intptr_t>(p32) & 31) == 0);
63 EXPECT((reinterpret_cast<intptr_t>(p64) & 63) == 0);
64 OS::AlignedFree(p16);
65 OS::AlignedFree(p32);
66 OS::AlignedFree(p64);
67 }
68
57 } // namespace dart 69 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698