ss: Add unit tests for state values
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.statesystem.core.tests / src / org / eclipse / tracecompass / statesystem / core / tests / statevalue / IntStateValueTest.java
1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.statesystem.core.tests.statevalue;
11
12 import static org.junit.Assert.assertEquals;
13
14 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
15 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue.Type;
16 import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
17 import org.junit.Test;
18
19 /**
20 * Test the integer state value class
21 *
22 * @author Geneviève Bastien
23 */
24 public class IntStateValueTest extends StateValueTestBase {
25
26 private static final int UNBOXED_VALUE = 34;
27 private static final TmfStateValue STATE_VALUE = TmfStateValue.newValueInt(UNBOXED_VALUE);
28
29
30 @Override
31 protected ITmfStateValue getStateValueFixture() {
32 return STATE_VALUE;
33 }
34
35 @Override
36 protected Type getStateValueType() {
37 return ITmfStateValue.Type.INTEGER;
38 }
39
40 @Override
41 @Test
42 public void testUnboxInt() {
43 int unboxed = STATE_VALUE.unboxInt();
44 assertEquals(UNBOXED_VALUE, unboxed);
45 }
46
47 @Override
48 @Test
49 public void testUnboxLong() {
50 long unboxed = STATE_VALUE.unboxLong();
51 assertEquals(UNBOXED_VALUE, unboxed);
52 }
53
54 }
This page took 0.043485 seconds and 5 git commands to generate.