X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=statesystem%2Forg.eclipse.tracecompass.statesystem.core.tests%2Fsrc%2Forg%2Feclipse%2Ftracecompass%2Fstatesystem%2Fcore%2Ftests%2Fstatevalue%2FIntStateValueTest.java;fp=statesystem%2Forg.eclipse.tracecompass.statesystem.core.tests%2Fsrc%2Forg%2Feclipse%2Ftracecompass%2Fstatesystem%2Fcore%2Ftests%2Fstatevalue%2FIntStateValueTest.java;h=584e0229091447bffe8877ae6ee5163d026d2e51;hb=fef07c8b7d740ed07ee855ceae7c391481ce73c2;hp=0000000000000000000000000000000000000000;hpb=1a334724c0ba89b3061a119167adb9c567869b7d;p=deliverable%2Ftracecompass.git diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/statevalue/IntStateValueTest.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/statevalue/IntStateValueTest.java new file mode 100644 index 0000000000..584e022909 --- /dev/null +++ b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/statevalue/IntStateValueTest.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2016 École Polytechnique de Montréal + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.tracecompass.statesystem.core.tests.statevalue; + +import static org.junit.Assert.assertEquals; + +import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue.Type; +import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue; +import org.junit.Test; + +/** + * Test the integer state value class + * + * @author Geneviève Bastien + */ +public class IntStateValueTest extends StateValueTestBase { + + private static final int UNBOXED_VALUE = 34; + private static final TmfStateValue STATE_VALUE = TmfStateValue.newValueInt(UNBOXED_VALUE); + + + @Override + protected ITmfStateValue getStateValueFixture() { + return STATE_VALUE; + } + + @Override + protected Type getStateValueType() { + return ITmfStateValue.Type.INTEGER; + } + + @Override + @Test + public void testUnboxInt() { + int unboxed = STATE_VALUE.unboxInt(); + assertEquals(UNBOXED_VALUE, unboxed); + } + + @Override + @Test + public void testUnboxLong() { + long unboxed = STATE_VALUE.unboxLong(); + assertEquals(UNBOXED_VALUE, unboxed); + } + +}