mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Fix MIMemoryTest.java:asynchronousReadWrite for architectures with fWordSize > 1
Commit 84a53f8d80
broke this test for an
architecture with fWordSize == 2. The buffer for writing a word went from
length fWordSize to 1, and the expected buffer size of a read as well.
This commit fixes it.
Change-Id: Ie50766031fc7dd8d480f126abc48a6dfd487b9e5
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
This commit is contained in:
parent
5ffc733ead
commit
74e4b6d504
1 changed files with 5 additions and 4 deletions
|
@ -239,6 +239,7 @@ public class MIMemoryTest extends BaseTestCase {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
* evaluateExpression
|
||||
* ------------------------------------------------------------------------
|
||||
|
@ -1177,8 +1178,7 @@ public class MIMemoryTest extends BaseTestCase {
|
|||
fSession, IMemoryChangedEvent.class);
|
||||
MemoryWriteQuery writeQueries[] = new MemoryWriteQuery[BLOCK_SIZE];
|
||||
for (int offset = 0; offset < BLOCK_SIZE; offset++) {
|
||||
byte[] block = new byte[1];
|
||||
block[0] = (byte) offset;
|
||||
byte[] block = valueToBytes(offset);
|
||||
|
||||
writeQueries[offset] = new MemoryWriteQuery(fMemoryService,
|
||||
fMemoryDmc, fBaseAddress, offset, fWordSize, 1, block);
|
||||
|
@ -1206,8 +1206,9 @@ public class MIMemoryTest extends BaseTestCase {
|
|||
// Wait for all the queries to finish
|
||||
for (int offset = 0; offset < BLOCK_SIZE; offset++) {
|
||||
MemoryByte[] data = readQueries[offset].get();
|
||||
assertThat(data.length, is(1));
|
||||
assertThat(data[0].getValue(), is((byte) offset));
|
||||
assertThat(data.length, is(fWordSize));
|
||||
MemoryByteBuffer mbb = new MemoryByteBuffer(data, fByteOrder, fWordSize);
|
||||
assertThat(mbb.getNextWord(), is((long) offset));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue