@@ -0,0 +1,2589 @@
+/*%0A * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.%0A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.%0A *%0A * This code is free software; you can redistribute it and/or modify it%0A * under the terms of the GNU General Public License version 2 only, as%0A * published by the Free Software Foundation.%0A *%0A * This code is distributed in the hope that it will be useful, but WITHOUT%0A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or%0A * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License%0A * version 2 for more details (a copy is included in the LICENSE file that%0A * accompanied this code).%0A *%0A * You should have received a copy of the GNU General Public License version%0A * 2 along with this work; if not, write to the Free Software Foundation,%0A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.%0A *%0A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA%0A * or visit www.oracle.com if you need additional information or have any%0A * questions.%0A */%0Apackage com.oracle.graal.api.meta.test;%0A%0Aimport org.junit.*;%0A%0Aimport com.oracle.graal.api.meta.*;%0A%0Apublic class ConstantTest extends FieldUniverse %7B%0A%0A    @Test%0A    public void testNegativeZero() %7B%0A        Assert.assertTrue(%22Constant for 0.0f must be different from -0.0f%22, Constant.FLOAT_0 != Constant.forFloat(-0.0F));%0A        Assert.assertTrue(%22Constant for 0.0d must be different from -0.0d%22, Constant.DOUBLE_0 != Constant.forDouble(-0.0d));%0A    %7D%0A%0A    @Test%0A    public void testNullIsNull() %7B%0A        Assert.assertTrue(Constant.NULL_OBJECT.isNull());%0A    %7D%0A%0A    @Test%0A    public void testOne() %7B%0A        for (Kind kind : Kind.values()) %7B%0A            if (kind.isNumericInteger() %7C%7C kind.isNumericFloat()) %7B%0A                Assert.assertTrue(Constant.one(kind).getKind() == kind);%0A            %7D%0A        %7D%0A        Assert.assertEquals(1, Constant.one(Kind.Int).asInt());%0A        Assert.assertEquals(1L, Constant.one(Kind.Long).asLong());%0A        Assert.assertEquals(1, Constant.one(Kind.Byte).asInt());%0A        Assert.assertEquals(1, Constant.one(Kind.Short).asInt());%0A        Assert.assertEquals(1, Constant.one(Kind.Char).asInt());%0A        Assert.assertTrue(1F == Constant.one(Kind.Float).asFloat());%0A        Assert.assertTrue(1D == Constant.one(Kind.Double).asDouble());%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testIllegalOne() %7B%0A        Constant.one(Kind.Illegal);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testVoidOne() %7B%0A        Constant.one(Kind.Void);%0A    %7D%0A%7D%0A

add test for Constant