Renamed test events to 0 and 1, matching their indices.

This commit is contained in:
NathanSweet 2016-11-28 15:39:16 +01:00
parent 38d925d1a7
commit 19bb3ccf35
3 changed files with 59 additions and 59 deletions

View File

@ -1,5 +1,5 @@
{
"skeleton": { "hash": "Qw/GA2Pge/zEE/8xq3vX9lpp4Qg", "spine": "3.0.00", "width": 0, "height": 0 },
"skeleton": { "hash": "C7XH8P2ZH7KYz8kafheHFboZI1Q", "spine": "3.5.32", "width": 0, "height": 0 },
"bones": [
{ "name": "root" }
],
@ -7,17 +7,17 @@
"event": {}
},
"animations": {
"events1": {
"events0": {
"events": [
{ "time": 0, "name": "event", "string": "0" },
{ "time": 0.4666, "name": "event", "string": "14" },
{ "time": 0.4667, "name": "event", "string": "14" },
{ "time": 1, "name": "event", "string": "30" }
]
},
"events2": {
"events1": {
"events": [
{ "time": 0, "name": "event", "string": "0" },
{ "time": 0.4666, "name": "event", "string": "14" },
{ "time": 0.4667, "name": "event", "string": "14" },
{ "time": 1, "name": "event", "string": "30" }
]
}

View File

@ -127,7 +127,7 @@ public class AnimationStateTests {
expect(0, "end", 1, 1.1f), //
expect(0, "dispose", 1, 1.1f) //
);
state.setAnimation(0, "events1", false);
state.setAnimation(0, "events0", false);
run(0.1f, 1000, null);
setup("1/60 time step, dispose queued", // 2
@ -143,17 +143,17 @@ public class AnimationStateTests {
expect(0, "start", 0, 0), //
expect(0, "event 0", 0, 0), //
expect(0, "event 14", 0.467f, 0.467f), //
expect(0, "event 14", 0.483f, 0.483f), //
expect(0, "event 30", 1, 1), //
expect(0, "complete", 1, 1), //
expect(0, "end", 1, 1.017f), //
expect(0, "dispose", 1, 1.017f) //
);
state.setAnimation(0, "events1", false);
state.addAnimation(0, "events2", false, 0);
state.setAnimation(0, "events0", false);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events2", false, 0);
state.setAnimation(0, "events1", false);
state.addAnimation(0, "events0", false, 0);
state.addAnimation(0, "events1", false, 0);
state.setAnimation(0, "events0", false);
run(1 / 60f, 1000, null);
setup("30 time step", // 3
@ -165,7 +165,7 @@ public class AnimationStateTests {
expect(0, "end", 30, 60), //
expect(0, "dispose", 30, 60) //
);
state.setAnimation(0, "events1", false);
state.setAnimation(0, "events0", false);
run(30, 1000, null);
setup("1 time step", // 4
@ -177,7 +177,7 @@ public class AnimationStateTests {
expect(0, "end", 1, 2), //
expect(0, "dispose", 1, 2) //
);
state.setAnimation(0, "events1", false);
state.setAnimation(0, "events0", false);
run(1, 1.01f, null);
setup("interrupt", // 5
@ -211,9 +211,9 @@ public class AnimationStateTests {
expect(0, "end", 1, 3.1f), //
expect(0, "dispose", 1, 3.1f) //
);
state.setAnimation(0, "events1", false);
state.addAnimation(0, "events2", false, 0);
state.setAnimation(0, "events0", false);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events0", false, 0);
run(0.1f, 4f, null);
setup("interrupt with delay", // 6
@ -234,8 +234,8 @@ public class AnimationStateTests {
expect(1, "end", 1, 1.6f), //
expect(1, "dispose", 1, 1.6f) //
);
state.setAnimation(0, "events1", false);
state.addAnimation(0, "events2", false, 0.5f);
state.setAnimation(0, "events0", false);
state.addAnimation(0, "events1", false, 0.5f);
run(0.1f, 1000, null);
setup("interrupt with delay and mix time", // 7
@ -259,9 +259,9 @@ public class AnimationStateTests {
expect(1, "end", 1, 2), //
expect(1, "dispose", 1, 2) //
);
stateData.setMix("events1", "events2", 0.7f);
state.setAnimation(0, "events1", true);
state.addAnimation(0, "events2", false, 0.9f);
stateData.setMix("events0", "events1", 0.7f);
state.setAnimation(0, "events0", true);
state.addAnimation(0, "events1", false, 0.9f);
run(0.1f, 1000, null);
setup("animation 0 events do not fire during mix", // 8
@ -283,8 +283,8 @@ public class AnimationStateTests {
expect(1, "dispose", 1, 1.5f) //
);
stateData.setDefaultMix(0.7f);
state.setAnimation(0, "events1", false);
state.addAnimation(0, "events2", false, 0.4f);
state.setAnimation(0, "events0", false);
state.addAnimation(0, "events1", false, 0.4f);
run(0.1f, 1000, null);
setup("event threshold, some animation 0 events fire during mix", // 9
@ -308,9 +308,9 @@ public class AnimationStateTests {
expect(1, "end", 1, 1.5f), //
expect(1, "dispose", 1, 1.5f) //
);
stateData.setMix("events1", "events2", 0.7f);
state.setAnimation(0, "events1", false).setEventThreshold(0.5f);
state.addAnimation(0, "events2", false, 0.4f);
stateData.setMix("events0", "events1", 0.7f);
state.setAnimation(0, "events0", false).setEventThreshold(0.5f);
state.addAnimation(0, "events1", false, 0.4f);
run(0.1f, 1000, null);
setup("event threshold, all animation 0 events fire during mix", // 10
@ -336,8 +336,8 @@ public class AnimationStateTests {
expect(1, "end", 1, 1.9f), //
expect(1, "dispose", 1, 1.9f) //
);
state.setAnimation(0, "events1", true).setEventThreshold(1);
state.addAnimation(0, "events2", false, 0.8f).setMixDuration(0.7f);
state.setAnimation(0, "events0", true).setEventThreshold(1);
state.addAnimation(0, "events1", false, 0.8f).setMixDuration(0.7f);
run(0.1f, 1000, null);
setup("looping", // 11
@ -360,7 +360,7 @@ public class AnimationStateTests {
expect(0, "complete", 4, 4), //
expect(0, "event 0", 4, 4) //
);
state.setAnimation(0, "events1", true);
state.setAnimation(0, "events0", true);
run(0.1f, 4, null);
setup("not looping, track end past animation 0 duration", // 12
@ -383,8 +383,8 @@ public class AnimationStateTests {
expect(1, "end", 1, 3.1f), //
expect(1, "dispose", 1, 3.1f) //
);
state.setAnimation(0, "events1", false);
state.addAnimation(0, "events2", false, 2);
state.setAnimation(0, "events0", false);
state.addAnimation(0, "events1", false, 2);
run(0.1f, 4f, null);
setup("interrupt animation after first loop complete", // 13
@ -412,10 +412,10 @@ public class AnimationStateTests {
expect(1, "end", 1, 3.1f), //
expect(1, "dispose", 1, 3.1f) //
);
state.setAnimation(0, "events1", true);
state.setAnimation(0, "events0", true);
run(0.1f, 6, new TestListener() {
public void frame (float time) {
if (MathUtils.isEqual(time, 1.4f)) state.addAnimation(0, "events2", false, 0);
if (MathUtils.isEqual(time, 1.4f)) state.addAnimation(0, "events1", false, 0);
}
});
@ -428,7 +428,7 @@ public class AnimationStateTests {
expect(0, "end", 1, 1.1f), //
expect(0, "dispose", 1, 1.1f) //
);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events0", false, 0);
run(0.1f, 1.9f, null);
setup("end time beyond non-looping animation duration", // 15
@ -440,7 +440,7 @@ public class AnimationStateTests {
expect(0, "end", 9f, 9.1f), //
expect(0, "dispose", 9f, 9.1f) //
);
state.setAnimation(0, "events1", false).setTrackEnd(9);
state.setAnimation(0, "events0", false).setTrackEnd(9);
run(0.1f, 10, null);
setup("looping with animation start", // 16
@ -452,7 +452,7 @@ public class AnimationStateTests {
expect(0, "event 30", 1.2f, 1.2f), //
expect(0, "complete", 1.2f, 1.2f) //
);
entry = state.setAnimation(0, "events1", true);
entry = state.setAnimation(0, "events0", true);
entry.setAnimationLast(0.6f);
entry.setAnimationStart(0.6f);
run(0.1f, 1.4f, null);
@ -465,7 +465,7 @@ public class AnimationStateTests {
expect(0, "complete", 1.2f, 1.2f), //
expect(0, "event 14", 1.5f, 1.5f) //
);
entry = state.setAnimation(0, "events1", true);
entry = state.setAnimation(0, "events0", true);
entry.setAnimationStart(0.2f);
entry.setAnimationLast(0.2f);
entry.setAnimationEnd(0.8f);
@ -478,7 +478,7 @@ public class AnimationStateTests {
expect(0, "end", 1, 1.1f), //
expect(0, "dispose", 1, 1.1f) //
);
entry = state.setAnimation(0, "events1", false);
entry = state.setAnimation(0, "events0", false);
entry.setAnimationStart(0.2f);
entry.setAnimationLast(0.2f);
entry.setAnimationEnd(0.8f);
@ -506,12 +506,12 @@ public class AnimationStateTests {
expect(1, "end", 1, 1.8f), //
expect(1, "dispose", 1, 1.8f) //
);
entry = state.setAnimation(0, "events1", true);
entry = state.setAnimation(0, "events0", true);
entry.setAnimationStart(0.2f);
entry.setAnimationLast(0.2f);
entry.setAnimationEnd(0.8f);
entry.setEventThreshold(1);
state.addAnimation(0, "events2", false, 0.7f).setMixDuration(0.7f);
state.addAnimation(0, "events1", false, 0.7f).setMixDuration(0.7f);
run(0.1f, 20, null);
setup("setAnimation with track entry mix", // 20
@ -536,10 +536,10 @@ public class AnimationStateTests {
expect(1, "end", 1, 2.1f), //
expect(1, "dispose", 1, 2.1f) //
);
state.setAnimation(0, "events1", true);
state.setAnimation(0, "events0", true);
run(0.1f, 1000, new TestListener() {
public void frame (float time) {
if (MathUtils.isEqual(time, 1f)) state.setAnimation(0, "events2", false).setMixDuration(0.7f);
if (MathUtils.isEqual(time, 1f)) state.setAnimation(0, "events1", false).setMixDuration(0.7f);
}
});
@ -570,13 +570,13 @@ public class AnimationStateTests {
expect(1, "end", 1, 1.9f), //
expect(1, "dispose", 1, 1.9f) //
);
state.setAnimation(0, "events1", false); // First should be ignored.
state.setAnimation(0, "events2", false);
state.setAnimation(0, "events0", false); // First should be ignored.
state.setAnimation(0, "events1", false);
run(0.1f, 1000, new TestListener() {
public void frame (float time) {
if (MathUtils.isEqual(time, 0.8f)) {
state.setAnimation(0, "events1", false); // First should be ignored.
state.setAnimation(0, "events2", false);
state.setAnimation(0, "events0", false); // First should be ignored.
state.setAnimation(0, "events1", false);
}
}
});
@ -590,38 +590,38 @@ public class AnimationStateTests {
expect(0, "end", 1, 6.1f), //
expect(0, "dispose", 1, 6.1f) //
);
state.addAnimation(0, "events1", false, 5);
state.addAnimation(0, "events0", false, 5);
run(0.1f, 10, null);
setup("setAnimation during AnimationStateListener"); // 23
state.addListener(new AnimationStateListener() {
public void start (TrackEntry entry) {
if (entry.getAnimation().getName().equals("events1")) state.setAnimation(1, "events2", false);
if (entry.getAnimation().getName().equals("events0")) state.setAnimation(1, "events1", false);
}
public void interrupt (TrackEntry entry) {
state.addAnimation(3, "events2", false, 0);
state.addAnimation(3, "events1", false, 0);
}
public void end (TrackEntry entry) {
if (entry.getAnimation().getName().equals("events1")) state.setAnimation(0, "events2", false);
if (entry.getAnimation().getName().equals("events0")) state.setAnimation(0, "events1", false);
}
public void dispose (TrackEntry entry) {
if (entry.getAnimation().getName().equals("events1")) state.setAnimation(1, "events2", false);
if (entry.getAnimation().getName().equals("events0")) state.setAnimation(1, "events1", false);
}
public void complete (TrackEntry entry) {
if (entry.getAnimation().getName().equals("events1")) state.setAnimation(1, "events2", false);
if (entry.getAnimation().getName().equals("events0")) state.setAnimation(1, "events1", false);
}
public void event (TrackEntry entry, Event event) {
if (entry.getTrackIndex() != 2) state.setAnimation(2, "events2", false);
if (entry.getTrackIndex() != 2) state.setAnimation(2, "events1", false);
}
});
state.addAnimation(0, "events0", false, 0);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events2", false, 0);
state.setAnimation(1, "events2", false);
state.setAnimation(1, "events1", false);
run(0.1f, 10, null);
setup("clearTrack", // 24
@ -631,7 +631,7 @@ public class AnimationStateTests {
expect(0, "end", 0.7f, 0.7f), //
expect(0, "dispose", 0.7f, 0.7f) //
);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events0", false, 0);
run(0.1f, 10, new TestListener() {
public void frame (float time) {
if (MathUtils.isEqual(time, 0.7f)) state.clearTrack(0);
@ -653,7 +653,7 @@ public class AnimationStateTests {
expect(-1, "end", 0.2f, 1), //
expect(-1, "dispose", 0.2f, 1) //
);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events0", false, 0);
run(0.1f, 10, new TestListener() {
public void frame (float time) {
if (MathUtils.isEqual(time, 0.7f)) state.setEmptyAnimation(0, 0);
@ -662,7 +662,7 @@ public class AnimationStateTests {
setup("TrackEntry listener"); // 26
final AtomicInteger counter = new AtomicInteger();
state.addAnimation(0, "events1", false, 0).setListener(new AnimationStateListener() {
state.addAnimation(0, "events0", false, 0).setListener(new AnimationStateListener() {
public void start (TrackEntry entry) {
counter.addAndGet(1 << 1);
}
@ -687,9 +687,9 @@ public class AnimationStateTests {
counter.addAndGet(1 << 21);
}
});
state.addAnimation(0, "events0", false, 0);
state.addAnimation(0, "events1", false, 0);
state.addAnimation(0, "events2", false, 0);
state.setAnimation(1, "events2", false);
state.setAnimation(1, "events1", false);
run(0.1f, 10, null);
if (counter.get() != 15082016) {
log("TEST 26 FAILED! " + counter);