* 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;
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;
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);