| Index: runtime/tests/vm/dart/inline_stack_frame_test.dart
|
| diff --git a/runtime/tests/vm/dart/inline_stack_frame_test.dart b/runtime/tests/vm/dart/inline_stack_frame_test.dart
|
| index e5538553ebe3e2f8f6ce3af36dd3acc8e26df50e..d39795715b44d5d24392fb07d9c412b4ccb88165 100644
|
| --- a/runtime/tests/vm/dart/inline_stack_frame_test.dart
|
| +++ b/runtime/tests/vm/dart/inline_stack_frame_test.dart
|
| @@ -4,8 +4,6 @@
|
|
|
| // VMOptions=--optimization_counter_threshold=10 --no-background-compilation
|
|
|
| -import "package:expect/expect.dart";
|
| -
|
| // This test tries to verify that we produce the correct stack trace when
|
| // throwing exceptions even when functions are inlined.
|
| // The test invokes a bunch of functions and then does a throw. There is a
|
| @@ -26,7 +24,7 @@ class Test {
|
| }
|
| return "";
|
| } catch (e, stacktrace) {
|
| - var result = e + stacktrace.toString();
|
| + var result = e + "\n" + stacktrace.toString();
|
| return result;
|
| }
|
| }
|
| @@ -57,22 +55,33 @@ class Test {
|
| }
|
| }
|
|
|
| +expectHasSubstring(String string, String substring) {
|
| + if (!string.contains(substring)) {
|
| + var sb = new StringBuffer();
|
| + sb.writeln("Expect string:");
|
| + sb.writeln(string);
|
| + sb.writeln("To have substring:");
|
| + sb.writeln(substring);
|
| + throw new Exception(sb.toString());
|
| + }
|
| +}
|
| +
|
| main() {
|
| var x = new Test();
|
| var result = x.func1(100000);
|
| - Expect.isTrue(result.contains("show me inlined functions"));
|
| - Expect.isTrue(result.contains("Test.func1"));
|
| - Expect.isTrue(result.contains("Test.func2"));
|
| - Expect.isTrue(result.contains("Test.func3"));
|
| - Expect.isTrue(result.contains("Test.func4"));
|
| - Expect.isTrue(result.contains("Test.func"));
|
| + expectHasSubstring(result, "show me inlined functions");
|
| + expectHasSubstring(result, "Test.func1");
|
| + expectHasSubstring(result, "Test.func2");
|
| + expectHasSubstring(result, "Test.func3");
|
| + expectHasSubstring(result, "Test.func4");
|
| + expectHasSubstring(result, "Test.func5");
|
| for (var i = 0; i <= 10; i++) {
|
| result = x.func1(i);
|
| }
|
| - Expect.isTrue(result.contains("show me inlined functions"));
|
| - Expect.isTrue(result.contains("Test.func1"));
|
| - Expect.isTrue(result.contains("Test.func2"));
|
| - Expect.isTrue(result.contains("Test.func3"));
|
| - Expect.isTrue(result.contains("Test.func4"));
|
| - Expect.isTrue(result.contains("Test.func5"));
|
| + expectHasSubstring(result, "show me inlined functions");
|
| + expectHasSubstring(result, "Test.func1");
|
| + expectHasSubstring(result, "Test.func2");
|
| + expectHasSubstring(result, "Test.func3");
|
| + expectHasSubstring(result, "Test.func4");
|
| + expectHasSubstring(result, "Test.func5");
|
| }
|
|
|