System.out.print(val);
System.out.print(", ");
}
- try {
- testSeekIndex(trace);
- } catch (CTFReaderException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- try {
- testSeekIndex(trace);
- } catch (CTFReaderException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
+ testSeekIndex(trace);
+ testSeekIndex(trace);
}
/**
return Long.MIN_VALUE;
}
- public static void testSeekIndex(CTFTrace trace) throws CTFReaderException {
+ public static void testSeekIndex(CTFTrace trace) {
CTFTraceReader fixture = new CTFTraceReader(trace);
long rank = 300000L;
long timeRank = 4281275394331L;
* Run the StreamInputReaderTimestampComparator() constructor test.
*/
@Test
- public void testStreamInputReaderTimestampComparator_1() throws Exception {
+ public void testStreamInputReaderTimestampComparator_1() {
assertNotNull(fixture);
}
import static org.junit.Assert.assertTrue;
import java.io.File;
+import java.io.IOException;
import java.nio.channels.FileChannel;
import org.eclipse.linuxtools.ctf.core.event.types.Definition;
/**
* Run the FileChannel getFileChannel() method test.
+ *
+ * @throws IOException
*/
@Test
- public void testGetFileChannel() {
+ public void testGetFileChannel() throws IOException {
FileChannel result = fixture.getFileChannel();
assertNull(result);
+ if (result != null) {
+ result.close();
+ }
}
/**
* @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++) {
}
@Test
- public void testToString() throws Exception {
+ public void testToString() {
Definition fixture = new DefTest(null, "Hello"); //$NON-NLS-1$
String result = fixture.toString();
* Run the SequenceDefinition lookupSequence(String) method test.
*/
@Test
- public void testLookupSequence_1() throws Exception {
+ public void testLookupSequence_1() {
String name = ""; //$NON-NLS-1$
SequenceDefinition result = fixture.lookupSequence(name);
assertNull(result);
/**
* Current event index
*/
- private long index;
+ private long fIndex;
private final long startIndex[];
*/
this.startTime = prio.peek().getCurrentEvent().timestamp;
this.endTime = this.startTime;
- this.index = 0;
+ this.fIndex = 0;
startIndex = new long[prio.size()];
for (int i = 0; i < prio.size(); i++) {
startIndex[i] = 0;
* @return the index
*/
public long getIndex() {
- return index;
+ return fIndex;
}
// ------------------------------------------------------------------------
if (!packetHasMoreEvents) {
int n = this.streamInputReaders.indexOf(top);
currentPacket.setIndexBegin(startIndex[n]);
- currentPacket.setIndexEnd(index);
- startIndex[n] = index + 1;
+ currentPacket.setIndexEnd(fIndex);
+ startIndex[n] = fIndex + 1;
}
}
/*
/*
* increment the index
*/
- index++;
+ fIndex++;
}
boolean hasMoreEvents = hasMoreEvents();
* Remove all the trace readers from the priority queue
*/
this.prio.clear();
- index = 0;
+ fIndex = 0;
long offset = 0;
for (StreamInputReader streamInputReader : this.streamInputReaders) {
/*
for (StreamInputReader streamInputReader : this.streamInputReaders) {
if (streamInputReader.getCurrentEvent() != null) {
this.prio.add(streamInputReader);
- index = Math.max(index, streamInputReader.getPacketReader()
+ fIndex = Math.max(fIndex, streamInputReader.getPacketReader()
.getCurrentPacket().getIndexBegin()
+ offset);
}
this.advance();
}
}
- this.index = pos;
+ this.fIndex = pos;
return hasMoreEvents();
}
*/
if (this.packetReader.getCurrentPacket() == null) {
throw new CTFReaderException(
- "Current packet null in index seek, did you index your trace yet?");
+ "Current packet null in index seek, did you index your trace yet?"); //$NON-NLS-1$
}
return this.packetReader.getCurrentPacket().getIndexBegin();
// Operations
// ------------------------------------------------------------------------
- @SuppressWarnings("unused")
@Override
public Definition lookupDefinition(String lookupPath) {
/* TODO: lookup in different dynamic scopes is not supported yet. */