aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-26 20:38:13 +0100
committerSven Gothel <[email protected]>2013-11-26 20:38:13 +0100
commit65247a8188c7470ee7f599f2e84cae1bc84fff9c (patch)
tree50ed5197fa6263b38bea5381fee40967e7e5c102 /src
parent9310b11b2b6e1e89fa5ed9b8de26e56ff6a6b262 (diff)
Refine DemoBug910ExtendedAWTAppletLifecycleCheck (commit 9310b11b2b6e1e89fa5ed9b8de26e56ff6a6b262): Test start/stop balance.
Diffstat (limited to 'src')
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java b/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
index 62891cc3c..1d7f6e78c 100644
--- a/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
+++ b/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
@@ -89,18 +89,20 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
volatile int destroyCount = 0;
private final void checkAppletState(String msg, boolean expIsActive,
- int expInitCount, int expStartCount, int expStopCount, int expDestroyCount) {
+ int expInitCount, int expStartCount, int expStopCount, boolean startStopCountEquals, int expDestroyCount) {
final boolean isActive = this.isActive();
final String okS = ( expInitCount == initCount &&
expIsActive == isActive &&
expStartCount == startCount &&
expStopCount == stopCount &&
- expDestroyCount == destroyCount ) ? "OK" : "ERROR";
+ expDestroyCount == destroyCount &&
+ ( !startStopCountEquals || startCount == stopCount ) ) ? "OK" : "ERROR";
println("Applet-State @ "+msg+": "+okS+
", active[exp "+expIsActive+", has "+isActive+"]"+(expIsActive!=isActive?"*":"")+
", init[exp "+expInitCount+", has "+initCount+"]"+(expInitCount!=initCount?"*":"")+
", start[exp "+expStartCount+", has "+startCount+"]"+(expStartCount!=startCount?"*":"")+
", stop[exp "+expStopCount+", has "+stopCount+"]"+(expStopCount!=stopCount?"*":"")+
+ ", start==stop[exp "+startStopCountEquals+", start "+startCount+", stop "+stopCount+"]"+(( startStopCountEquals && startCount != stopCount )?"*":"")+
", destroy[exp "+expDestroyCount+", has "+destroyCount+"]"+(expDestroyCount!=destroyCount?"*":""));
}
@@ -159,7 +161,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
final java.awt.Dimension aSize = getSize();
println("Applet.init() START - applet.size "+aSize+" - "+currentThreadName());
initCount++;
- checkAppletState("init", false /* expIsActive */, 1 /* expInitCount */, 0 /* expStartCount */, 0 /* expStopCount */, 0 /* expDestroyCount */);
+ checkAppletState("init", false /* expIsActive */, 1 /* expInitCount */,
+ 0 /* expStartCount */, 0 /* expStopCount */, true /* startStopCountEquals */,
+ 0 /* expDestroyCount */);
invoke(true, new Runnable() {
public void run() {
setLayout(new BorderLayout());
@@ -179,7 +183,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
public void start() {
println("Applet.start() START (isVisible "+isVisible()+", isDisplayable "+isDisplayable()+") - "+currentThreadName());
startCount++;
- checkAppletState("start", true /* expIsActive */, 1 /* expInitCount */, startCount /* expStartCount */, stopCount /* expStopCount */, 0 /* expDestroyCount */);
+ checkAppletState("start", true /* expIsActive */, 1 /* expInitCount */,
+ startCount /* expStartCount */, startCount-1 /* expStopCount */, false /* startStopCountEquals */,
+ 0 /* expDestroyCount */);
invoke(true, new Runnable() {
public void run() {
checkComponentState("start-visible.pre", true, 1, 0);
@@ -199,7 +205,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
public void stop() {
println("Applet.stop() START - "+currentThreadName());
stopCount++;
- checkAppletState("stop", false /* expIsActive */, 1 /* expInitCount */, stopCount /* expStartCount */, stopCount /* expStopCount */, 0 /* expDestroyCount */);
+ checkAppletState("stop", false /* expIsActive */, 1 /* expInitCount */,
+ stopCount /* expStartCount */, stopCount /* expStopCount */, true /* startStopCountEquals */,
+ 0 /* expDestroyCount */);
invoke(true, new Runnable() {
public void run() {
checkComponentState("stop", true, 1, 0);
@@ -211,7 +219,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
public void destroy() {
println("Applet.destroy() START - "+currentThreadName());
destroyCount++;
- checkAppletState("destroy", false /* expIsActive */, 1 /* expInitCount */, startCount /* expStartCount */, stopCount /* expStopCount */, 1 /* expDestroyCount */);
+ checkAppletState("destroy", false /* expIsActive */, 1 /* expInitCount */,
+ startCount /* expStartCount */, stopCount /* expStopCount */, true /* startStopCountEquals */,
+ 1 /* expDestroyCount */);
invoke(true, new Runnable() {
public void run() {
checkComponentState("destroy-remove.pre", true, 1, 0);