ctf: Throw CTFReaderException in the BitBuffer API
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / types / IntegerEndiannessTest.java
index 6f2175b029faaaff09c156380a2cdca61f77f57b..8801313148791554ddd8312ea69a0a60f5398baf 100644 (file)
@@ -9,6 +9,7 @@
  * Contributors:
  *   Geneviève Bastien - Initial API and implementation
  *   Alexandre Montplaisir - Split out in separate class
+ *   Matthew Khouzam - update api (exceptions)
  *******************************************************************************/
 
 package org.eclipse.linuxtools.ctf.core.tests.types;
@@ -22,6 +23,7 @@ import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
 import org.eclipse.linuxtools.ctf.core.event.types.Encoding;
 import org.eclipse.linuxtools.ctf.core.event.types.IntegerDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.IntegerDefinition;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -55,36 +57,56 @@ public class IntegerEndiannessTest {
         input = new BitBuffer(bb);
     }
 
-    /** Read 32-bits BE */
+    /**
+     * Read 32-bits BE
+     *
+     * @throws CTFReaderException
+     *             error
+     */
     @Test
-    public void test32BE() {
+    public void test32BE() throws CTFReaderException {
         IntegerDeclaration be = new IntegerDeclaration(32, true, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_be = be.createDefinition(null, name);
         fixture_be.read(input);
         assertEquals(0xabcdef12, fixture_be.getValue());
     }
 
-    /** Read 64-bits BE */
+    /**
+     * Read 64-bits BE
+     *
+     * @throws CTFReaderException
+     *             error
+     */
     @Test
-    public void test64BE() {
+    public void test64BE() throws CTFReaderException {
         IntegerDeclaration be = new IntegerDeclaration(64, true, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_be = be.createDefinition(null, name);
         fixture_be.read(input);
         assertEquals(0xabcdef123456789aL, fixture_be.getValue());
     }
 
-    /** Read 32-bits LE */
+    /**
+     * Read 32-bits LE
+     *
+     * @throws CTFReaderException
+     *             error
+     */
     @Test
-    public void test32LE() {
+    public void test32LE() throws CTFReaderException {
         IntegerDeclaration le = new IntegerDeclaration(32, true, 1, ByteOrder.LITTLE_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_le = le.createDefinition(null, name);
         fixture_le.read(input);
         assertEquals(0x12efcdab, fixture_le.getValue());
     }
 
-    /** Read 64-bits LE */
+    /**
+     * Read 64-bits LE
+     *
+     * @throws CTFReaderException
+     *             error
+     */
     @Test
-    public void test64LE() {
+    public void test64LE() throws CTFReaderException {
         IntegerDeclaration le = new IntegerDeclaration(64, true, 1, ByteOrder.LITTLE_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_le = le.createDefinition(null, name);
         fixture_le.read(input);
This page took 0.025384 seconds and 5 git commands to generate.