Skip to content

Commit aea9328

Browse files
committed
tests: Add AVM2 stack trace tests
These tests check whether stack traces are returned based on the SWF version and the debug/release mode.
1 parent decc7ec commit aea9328

File tree

20 files changed

+120
-0
lines changed

20 files changed

+120
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package {
2+
import flash.display.*;
3+
import flash.geom.*;
4+
5+
[SWF(width="10", height="10")]
6+
public class Test extends Sprite {
7+
public function Test() {
8+
var st = new Error().getStackTrace();
9+
var rect = new Sprite();
10+
if (st === null) {
11+
rect.graphics.beginFill(0xFF0000);
12+
} else if (st === undefined) {
13+
rect.graphics.beginFill(0x00FF00);
14+
} else {
15+
rect.graphics.beginFill(0x0000FF);
16+
}
17+
rect.graphics.drawRect(0, 0, 10, 10);
18+
rect.graphics.endFill();
19+
addChild(rect);
20+
}
21+
}
22+
}
Loading

tests/tests/swfs/avm2/error_stack_trace_debug_swf17/output.txt

Whitespace-only changes.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
num_ticks = 1
2+
3+
[image_comparisons.output]
4+
tolerance = 0
5+
6+
[player_options]
7+
mode = "Debug"
8+
with_renderer = { optional = false, sample_count = 4 }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package {
2+
import flash.display.*;
3+
import flash.geom.*;
4+
5+
[SWF(width="10", height="10")]
6+
public class Test extends Sprite {
7+
public function Test() {
8+
var st = new Error().getStackTrace();
9+
var rect = new Sprite();
10+
if (st === null) {
11+
rect.graphics.beginFill(0xFF0000);
12+
} else if (st === undefined) {
13+
rect.graphics.beginFill(0x00FF00);
14+
} else {
15+
rect.graphics.beginFill(0x0000FF);
16+
}
17+
rect.graphics.drawRect(0, 0, 10, 10);
18+
rect.graphics.endFill();
19+
addChild(rect);
20+
}
21+
}
22+
}
Loading

tests/tests/swfs/avm2/error_stack_trace_debug_swf18/output.txt

Whitespace-only changes.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
num_ticks = 1
2+
3+
[image_comparisons.output]
4+
tolerance = 0
5+
6+
[player_options]
7+
mode = "Debug"
8+
with_renderer = { optional = false, sample_count = 4 }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package {
2+
import flash.display.*;
3+
import flash.geom.*;
4+
5+
[SWF(width="10", height="10")]
6+
public class Test extends Sprite {
7+
public function Test() {
8+
var st = new Error().getStackTrace();
9+
var rect = new Sprite();
10+
if (st === null) {
11+
rect.graphics.beginFill(0xFF0000);
12+
} else if (st === undefined) {
13+
rect.graphics.beginFill(0x00FF00);
14+
} else {
15+
rect.graphics.beginFill(0x0000FF);
16+
}
17+
rect.graphics.drawRect(0, 0, 10, 10);
18+
rect.graphics.endFill();
19+
addChild(rect);
20+
}
21+
}
22+
}
Loading

tests/tests/swfs/avm2/error_stack_trace_release_swf17/output.txt

Whitespace-only changes.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
num_ticks = 1
2+
3+
[image_comparisons.output]
4+
tolerance = 0
5+
6+
[player_options]
7+
mode = "Release"
8+
with_renderer = { optional = false, sample_count = 4 }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package {
2+
import flash.display.*;
3+
import flash.geom.*;
4+
5+
[SWF(width="10", height="10")]
6+
public class Test extends Sprite {
7+
public function Test() {
8+
var st = new Error().getStackTrace();
9+
var rect = new Sprite();
10+
if (st === null) {
11+
rect.graphics.beginFill(0xFF0000);
12+
} else if (st === undefined) {
13+
rect.graphics.beginFill(0x00FF00);
14+
} else {
15+
rect.graphics.beginFill(0x0000FF);
16+
}
17+
rect.graphics.drawRect(0, 0, 10, 10);
18+
rect.graphics.endFill();
19+
addChild(rect);
20+
}
21+
}
22+
}
Loading

tests/tests/swfs/avm2/error_stack_trace_release_swf18/output.txt

Whitespace-only changes.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
num_ticks = 1
2+
3+
[image_comparisons.output]
4+
tolerance = 0
5+
6+
[player_options]
7+
mode = "Release"
8+
with_renderer = { optional = false, sample_count = 4 }

0 commit comments

Comments
 (0)