Commit | Line | Data |
---|---|---|
4bd7f2db AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2013 Ericsson | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Matthew Khouzam - Initial API and implementation | |
10 | *******************************************************************************/ | |
11 | ||
51209785 MK |
12 | package org.eclipse.linuxtools.ctf.core.tests.types; |
13 | ||
14 | import static org.junit.Assert.assertEquals; | |
15 | import static org.junit.Assert.assertNotNull; | |
16 | import static org.junit.Assert.assertTrue; | |
17 | ||
18 | import java.nio.ByteOrder; | |
19 | ||
51209785 MK |
20 | import org.eclipse.linuxtools.ctf.core.event.types.FloatDeclaration; |
21 | import org.junit.Test; | |
22 | ||
be6df2d8 | 23 | @SuppressWarnings("javadoc") |
51209785 MK |
24 | public class FloatDeclarationTest { |
25 | private FloatDeclaration fixture; | |
26 | ||
27 | ||
28 | @Test | |
29 | public void ctorTest() { | |
30 | for( int i = 1; i < 20; i++) { | |
07002e0a | 31 | fixture = new FloatDeclaration(i, 32-i, ByteOrder.nativeOrder(), 0); |
51209785 MK |
32 | assertNotNull(fixture); |
33 | } | |
34 | } | |
35 | ||
36 | @Test | |
37 | public void getterTest() { | |
07002e0a | 38 | fixture = new FloatDeclaration(8, 24, ByteOrder.nativeOrder(), 0); |
51209785 MK |
39 | assertEquals( fixture.getAlignment(), 0); |
40 | assertEquals( fixture.getByteOrder(), ByteOrder.nativeOrder()); | |
51209785 MK |
41 | assertEquals( fixture.getExponent(), 8); |
42 | assertEquals( fixture.getMantissa(), 24); | |
43 | } | |
44 | ||
45 | @Test | |
46 | public void toStringTest() { | |
07002e0a | 47 | fixture = new FloatDeclaration(8, 24, ByteOrder.nativeOrder(), 0); |
51209785 MK |
48 | assertTrue(fixture.toString().contains("float")); //$NON-NLS-1$ |
49 | } | |
50 | } |