~ubuntu-branches/ubuntu/vivid/mozjs24/vivid

« back to all changes in this revision

Viewing changes to js/src/jsapi-tests/selfTest.cpp

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-02-11 21:55:34 UTC
  • Revision ID: package-import@ubuntu.com-20140211215534-m1zyq5aj59md3y07
Tags: upstream-24.2.0
ImportĀ upstreamĀ versionĀ 24.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 
2
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 
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
 
 
9
#include "tests.h"
 
10
 
 
11
BEGIN_TEST(selfTest_NaNsAreSame)
 
12
{
 
13
    JS::RootedValue v1(cx), v2(cx);
 
14
    EVAL("0/0", v1.address());  // NaN
 
15
    CHECK_SAME(v1, v1);
 
16
 
 
17
    EVAL("Math.sin('no')", v2.address());  // also NaN
 
18
    CHECK_SAME(v1, v2);
 
19
    return true;
 
20
}
 
21
END_TEST(selfTest_NaNsAreSame)
 
22
 
 
23
BEGIN_TEST(selfTest_globalHasNoParent)
 
24
{
 
25
    CHECK(JS_GetParent(global) == NULL);
 
26
    return true;
 
27
}
 
28
END_TEST(selfTest_globalHasNoParent)