lttng: Make sure we assign a value to all created quarks
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / types / FloatDeclarationTest.java
CommitLineData
51209785
MK
1package org.eclipse.linuxtools.ctf.core.tests.types;
2
3import static org.junit.Assert.assertEquals;
4import static org.junit.Assert.assertNotNull;
5import static org.junit.Assert.assertTrue;
6
7import java.nio.ByteOrder;
8
9import org.eclipse.linuxtools.ctf.core.event.types.Encoding;
10import org.eclipse.linuxtools.ctf.core.event.types.FloatDeclaration;
11import org.junit.Test;
12
13
14public 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}
This page took 0.026773 seconds and 5 git commands to generate.