import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
import org.eclipse.linuxtools.ctf.core.event.types.ArrayDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.ArrayDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.Definition;
import org.eclipse.linuxtools.ctf.core.event.types.IntegerDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.StringDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.StringDefinition;
-import org.eclipse.linuxtools.ctf.core.tests.TestParams;
-import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
-import org.eclipse.linuxtools.internal.ctf.core.event.io.BitBuffer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
*
* structDef shouldn't be null after parsing the CTFTraceReader object, so
* we can ignore the warning.
- *
- * @throws CTFReaderException
*/
@Before
- public void setUp() throws CTFReaderException {
- this.trace = TestParams.createTrace();
-
+ public void setUp() {
charArrayFixture = createCharArray();
stringArrayFixture = createStringArray();
longArrayFixture = createLongArray();
}
private ArrayDefinition createLongArray() {
- IntegerDeclaration decl = new IntegerDeclaration(32, false, 10, ByteOrder.BIG_ENDIAN, Encoding.NONE, "none"); //$NON-NLS-1$
+ IntegerDeclaration decl = new IntegerDeclaration(32, false, 10, ByteOrder.BIG_ENDIAN, Encoding.NONE, "none",8); //$NON-NLS-1$
IntegerDefinition[] defs = createIntDefs(10, 32);
ArrayDefinition temp = setUpDeclaration(decl, defs);
return temp;
}
private ArrayDefinition createCharArray() {
- IntegerDeclaration decl = new IntegerDeclaration(8, false, 10, ByteOrder.BIG_ENDIAN, Encoding.UTF8, "none"); //$NON-NLS-1$
+ IntegerDeclaration decl = new IntegerDeclaration(8, false, 10, ByteOrder.BIG_ENDIAN, Encoding.UTF8, "none",8); //$NON-NLS-1$
IntegerDefinition[] defs = createIntDefs(4,8);
ArrayDefinition temp = setUpDeclaration(decl, defs);
return temp;
* @param bits
* @return
*/
- private IntegerDefinition[] createIntDefs(int size, int bits) {
+ private static IntegerDefinition[] createIntDefs(int size, int bits) {
IntegerDefinition[] defs = new IntegerDefinition[size];
for (int i = 0; i < size; i++) {
String content = "test" + i; //$NON-NLS-1$
defs[i] = new IntegerDefinition(new IntegerDeclaration(bits, false,
- 16, ByteOrder.LITTLE_ENDIAN, Encoding.UTF8, content), null, content);
+ 16, ByteOrder.LITTLE_ENDIAN, Encoding.UTF8, content, 24), null, content);
defs[i].setValue(i);
}
return defs;
@Test
public void testIsString_complex() {
final IntegerDeclaration id = new IntegerDeclaration(8, false, 16,
- ByteOrder.LITTLE_ENDIAN, Encoding.UTF8, null);
+ ByteOrder.LITTLE_ENDIAN, Encoding.UTF8, null, 8);
ArrayDeclaration ad = new ArrayDeclaration(0, id);
ArrayDefinition ownFixture = new ArrayDefinition(ad, this.trace,
"Testx"); //$NON-NLS-1$