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

Side by Side Diff: test/cctest/test-checks.cc

Issue 813813003: Revert of Remove obsolete V8_INFINITY macro. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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
« no previous file with comments | « test/cctest/test-assembler-arm64.cc ('k') | test/cctest/test-double.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/checks.h" 5 #include "src/checks.h"
6 6
7 #include "test/cctest/cctest.h" 7 #include "test/cctest/cctest.h"
8 8
9 9
10 TEST(CheckEqualsZeroAndMinusZero) { 10 TEST(CheckEqualsZeroAndMinusZero) {
11 CHECK_EQ(0.0, 0.0); 11 CHECK_EQ(0.0, 0.0);
12 CHECK_NE(0.0, -0.0); 12 CHECK_NE(0.0, -0.0);
13 CHECK_NE(-0.0, 0.0); 13 CHECK_NE(-0.0, 0.0);
14 CHECK_EQ(-0.0, -0.0); 14 CHECK_EQ(-0.0, -0.0);
15 } 15 }
16 16
17 17
18 TEST(CheckEqualsReflexivity) { 18 TEST(CheckEqualsReflexivity) {
19 double inf = std::numeric_limits<double>::infinity(); 19 double inf = V8_INFINITY;
20 double nan = v8::base::OS::nan_value(); 20 double nan = v8::base::OS::nan_value();
21 double constants[] = {-nan, -inf, -3.1415, -1.0, -0.1, -0.0, 21 double constants[] = {-nan, -inf, -3.1415, -1.0, -0.1, -0.0,
22 0.0, 0.1, 1.0, 3.1415, inf, nan}; 22 0.0, 0.1, 1.0, 3.1415, inf, nan};
23 for (size_t i = 0; i < arraysize(constants); ++i) { 23 for (size_t i = 0; i < arraysize(constants); ++i) {
24 CHECK_EQ(constants[i], constants[i]); 24 CHECK_EQ(constants[i], constants[i]);
25 } 25 }
26 } 26 }
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-arm64.cc ('k') | test/cctest/test-double.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698