OLD | NEW |
1 // Copyright (c) 2011, 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 "vm/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/unit_test.h" | 6 #include "vm/unit_test.h" |
7 #include "vm/utils.h" | 7 #include "vm/utils.h" |
8 | 8 |
9 namespace dart { | 9 namespace dart { |
10 | 10 |
11 UNIT_TEST_CASE(Minimum) { | 11 UNIT_TEST_CASE(Minimum) { |
12 EXPECT_EQ(0, Utils::Minimum(0, 1)); | 12 EXPECT_EQ(0, Utils::Minimum(0, 1)); |
13 EXPECT_EQ(0, Utils::Minimum(1, 0)); | 13 EXPECT_EQ(0, Utils::Minimum(1, 0)); |
14 | 14 |
15 EXPECT_EQ(1, Utils::Minimum(1, 2)); | 15 EXPECT_EQ(1, Utils::Minimum(1, 2)); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 UNIT_TEST_CASE(LowBits) { | 162 UNIT_TEST_CASE(LowBits) { |
163 EXPECT_EQ(0xff00, Utils::Low16Bits(0xffff00)); | 163 EXPECT_EQ(0xff00, Utils::Low16Bits(0xffff00)); |
164 EXPECT_EQ(0xff, Utils::High16Bits(0xffff00)); | 164 EXPECT_EQ(0xff, Utils::High16Bits(0xffff00)); |
165 EXPECT_EQ(0xff00, Utils::Low32Bits(0xff0000ff00LL)); | 165 EXPECT_EQ(0xff00, Utils::Low32Bits(0xff0000ff00LL)); |
166 EXPECT_EQ(0xff, Utils::High32Bits(0xff0000ff00LL)); | 166 EXPECT_EQ(0xff, Utils::High32Bits(0xff0000ff00LL)); |
167 EXPECT_EQ(0x00ff0000ff00LL, Utils::LowHighTo64Bits(0xff00, 0x00ff)); | 167 EXPECT_EQ(0x00ff0000ff00LL, Utils::LowHighTo64Bits(0xff00, 0x00ff)); |
168 } | 168 } |
169 | 169 |
170 } // namespace dart | 170 } // namespace dart |
OLD | NEW |