test/script/basic/JDK-8147845.js

Tue, 21 Mar 2017 13:41:57 -0700

author
asaha
date
Tue, 21 Mar 2017 13:41:57 -0700
changeset 2160
1df40fe54cd6
parent 1722
835b5b933b0a
permissions
-rw-r--r--

Merge

hannesw@1722 1 /*
hannesw@1722 2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
hannesw@1722 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
hannesw@1722 4 *
hannesw@1722 5 * This code is free software; you can redistribute it and/or modify it
hannesw@1722 6 * under the terms of the GNU General Public License version 2 only, as
hannesw@1722 7 * published by the Free Software Foundation.
hannesw@1722 8 *
hannesw@1722 9 * This code is distributed in the hope that it will be useful, but WITHOUT
hannesw@1722 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
hannesw@1722 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
hannesw@1722 12 * version 2 for more details (a copy is included in the LICENSE file that
hannesw@1722 13 * accompanied this code).
hannesw@1722 14 *
hannesw@1722 15 * You should have received a copy of the GNU General Public License version
hannesw@1722 16 * 2 along with this work; if not, write to the Free Software Foundation,
hannesw@1722 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
hannesw@1722 18 *
hannesw@1722 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
hannesw@1722 20 * or visit www.oracle.com if you need additional information or have any
hannesw@1722 21 * questions.
hannesw@1722 22 */
hannesw@1722 23
hannesw@1722 24 /**
hannesw@1722 25 * JDK-8147845: Varargs Array functions still leaking longs
hannesw@1722 26 *
hannesw@1722 27 * @test
hannesw@1722 28 * @run
hannesw@1722 29 */
hannesw@1722 30
hannesw@1722 31 Assert.assertTrue([].push() === 0);
hannesw@1722 32 Assert.assertTrue([].unshift() === 0);
hannesw@1722 33 Assert.assertTrue(typeof [].push() === 'number');
hannesw@1722 34 Assert.assertTrue(typeof [].unshift() === 'number');
hannesw@1722 35
hannesw@1722 36 Assert.assertTrue([].push(1, 2, 3) === 3);
hannesw@1722 37 Assert.assertTrue([].unshift(1, 2, 3) === 3);
hannesw@1722 38 Assert.assertTrue(typeof [].push(1, 2, 3) === 'number');
hannesw@1722 39 Assert.assertTrue(typeof [].unshift(1, 2, 3) === 'number');
hannesw@1722 40
hannesw@1722 41 Assert.assertTrue([].push(1) === 1);
hannesw@1722 42 Assert.assertTrue([].unshift(1) === 1);
hannesw@1722 43 Assert.assertTrue(typeof [].push(1) === 'number');
hannesw@1722 44 Assert.assertTrue(typeof [].unshift(1) === 'number');

mercurial