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

Unified Diff: test/cctest/test-checks.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-checks.cc
diff --git a/test/cctest/test-checks.cc b/test/cctest/test-checks.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5dea625e1db96f5de9fce3d9068a3623077647b9
--- /dev/null
+++ b/test/cctest/test-checks.cc
@@ -0,0 +1,27 @@
+// 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 < ARRAY_SIZE(constants); ++i) {
+ CHECK_EQ(constants[i], constants[i]);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698