mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-11-16-21'
This commit is contained in:
commit
d1b34b636c
1 changed files with 15 additions and 6 deletions
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
package ghidra.async;
|
||||
|
||||
import static ghidra.async.AsyncUtils.sequence;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static ghidra.async.AsyncUtils.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
@ -57,7 +57,7 @@ public class AsyncLockTest {
|
|||
}, TypeSpec.INT).then((val, seq) -> {
|
||||
convertValue(val + 10).handle(seq::next);
|
||||
}, TypeSpec.STRING).then((str, seq) -> {
|
||||
System.out.println(str);
|
||||
Msg.debug(this, str);
|
||||
seq.exit();
|
||||
}).finish();
|
||||
}
|
||||
|
@ -286,7 +286,14 @@ public class AsyncLockTest {
|
|||
|
||||
@Test
|
||||
public void testThrash() throws Exception {
|
||||
AsyncLock l = new AsyncLock("testThrash Lock");
|
||||
|
||||
boolean debug = false;
|
||||
|
||||
// This generates copious log messages; enable only when debugging
|
||||
AsyncLock l = new AsyncLock();
|
||||
if (debug) {
|
||||
l = new AsyncLock("testThrash Lock");
|
||||
}
|
||||
|
||||
var noSync = new Object() {
|
||||
int total = 0;
|
||||
|
@ -297,8 +304,10 @@ public class AsyncLockTest {
|
|||
final int _i = i;
|
||||
fence.include(l.with(TypeSpec.VOID, null).then((hold, seq) -> {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
Msg.info(this, "i: " + _i);
|
||||
Msg.info(this, "Depth: " + new Throwable().getStackTrace().length);
|
||||
if (debug) {
|
||||
Msg.info(this, "i: " + _i);
|
||||
Msg.info(this, "Depth: " + new Throwable().getStackTrace().length);
|
||||
}
|
||||
//assert noSync.total == 0;
|
||||
noSync.total++;
|
||||
}).handle(seq::next);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue