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 "platform/utils.h" | 6 #include "platform/utils.h" |
7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
8 | 8 |
9 namespace dart { | 9 namespace dart { |
10 | 10 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 EXPECT_EQ(0xf4, reinterpret_cast<uint8_t*>(&value64le)[0]); | 212 EXPECT_EQ(0xf4, reinterpret_cast<uint8_t*>(&value64le)[0]); |
213 EXPECT_EQ(0xf3, reinterpret_cast<uint8_t*>(&value64le)[1]); | 213 EXPECT_EQ(0xf3, reinterpret_cast<uint8_t*>(&value64le)[1]); |
214 EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value64le)[2]); | 214 EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value64le)[2]); |
215 EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value64le)[3]); | 215 EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value64le)[3]); |
216 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[4]); | 216 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[4]); |
217 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[5]); | 217 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[5]); |
218 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[6]); | 218 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[6]); |
219 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[7]); | 219 EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[7]); |
220 } | 220 } |
221 | 221 |
| 222 |
| 223 UNIT_TEST_CASE(DoublesBitEqual) { |
| 224 EXPECT(Utils::DoublesBitEqual(1.0, 1.0)); |
| 225 EXPECT(!Utils::DoublesBitEqual(1.0, -1.0)); |
| 226 EXPECT(Utils::DoublesBitEqual(0.0, 0.0)); |
| 227 EXPECT(!Utils::DoublesBitEqual(0.0, -0.0)); |
| 228 EXPECT(Utils::DoublesBitEqual(NAN, NAN)); |
| 229 } |
| 230 |
222 } // namespace dart | 231 } // namespace dart |
OLD | NEW |