selfTest.cpp (591B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 #include "jsapi-tests/tests.h" 9 10 BEGIN_TEST(selfTest_NaNsAreSame) { 11 JS::RootedValue v1(cx), v2(cx); 12 EVAL("0/0", &v1); // NaN 13 CHECK_SAME(v1, v1); 14 15 EVAL("Math.sin('no')", &v2); // also NaN 16 CHECK_SAME(v1, v2); 17 return true; 18 } 19 END_TEST(selfTest_NaNsAreSame)