Commit | Line | Data |
---|---|---|
51209785 MK |
1 | package org.eclipse.linuxtools.ctf.core.tests.types; |
2 | ||
3 | import static org.junit.Assert.assertEquals; | |
4 | import static org.junit.Assert.assertNotNull; | |
5 | import static org.junit.Assert.assertTrue; | |
6 | ||
7 | import java.nio.ByteOrder; | |
8 | ||
9 | import org.eclipse.linuxtools.ctf.core.event.types.Encoding; | |
10 | import org.eclipse.linuxtools.ctf.core.event.types.FloatDeclaration; | |
11 | import org.junit.Test; | |
12 | ||
13 | ||
14 | public class FloatDeclarationTest { | |
15 | private FloatDeclaration fixture; | |
16 | ||
17 | ||
18 | @Test | |
19 | public void ctorTest() { | |
20 | for( int i = 1; i < 20; i++) { | |
21 | fixture = new FloatDeclaration(i, 32-i, ByteOrder.nativeOrder(), Encoding.NONE, 0); | |
22 | assertNotNull(fixture); | |
23 | } | |
24 | } | |
25 | ||
26 | @Test | |
27 | public void getterTest() { | |
28 | fixture = new FloatDeclaration(8, 24, ByteOrder.nativeOrder(), Encoding.NONE, 0); | |
29 | assertEquals( fixture.getAlignment(), 0); | |
30 | assertEquals( fixture.getByteOrder(), ByteOrder.nativeOrder()); | |
31 | assertEquals( fixture.getEncoding(), Encoding.NONE); | |
32 | assertEquals( fixture.getExponent(), 8); | |
33 | assertEquals( fixture.getMantissa(), 24); | |
34 | } | |
35 | ||
36 | @Test | |
37 | public void toStringTest() { | |
38 | fixture = new FloatDeclaration(8, 24, ByteOrder.nativeOrder(), Encoding.NONE, 0); | |
39 | assertTrue(fixture.toString().contains("float")); //$NON-NLS-1$ | |
40 | } | |
41 | } |