v8/test/cctest/test-checks.cc
machenbach 7d478d9621 Revert of Remove obsolete V8_INFINITY macro. (patchset #3 id:40001 of https://codereview.chromium.org/798413003/)
Reason for revert:
Speculative revert. This seems to block the current roll: https://codereview.chromium.org/819653003/

I retried several times, also with a new roll. The error is internal - but that doesn't make much of a difference.

Original issue's description:
> Remove obsolete V8_INFINITY macro.
>
> Use std::numeric_limits consistently.
>
> R=svenpanne@chromium.org
>
> Committed: https://crrev.com/31c66e2d53569c4e229d55483d28208491e73612
> Cr-Commit-Position: refs/heads/master@{#25897}

TBR=svenpanne@chromium.org,bmeurer@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/813813003

Cr-Commit-Position: refs/heads/master@{#25912}
2014-12-20 13:17:35 +00:00

27 lines
692 B
C++

// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/checks.h"
#include "test/cctest/cctest.h"
TEST(CheckEqualsZeroAndMinusZero) {
CHECK_EQ(0.0, 0.0);
CHECK_NE(0.0, -0.0);
CHECK_NE(-0.0, 0.0);
CHECK_EQ(-0.0, -0.0);
}
TEST(CheckEqualsReflexivity) {
double inf = V8_INFINITY;
double nan = v8::base::OS::nan_value();
double constants[] = {-nan, -inf, -3.1415, -1.0, -0.1, -0.0,
0.0, 0.1, 1.0, 3.1415, inf, nan};
for (size_t i = 0; i < arraysize(constants); ++i) {
CHECK_EQ(constants[i], constants[i]);
}
}