Files
sdk/tests/language/stacktrace_test.dart
T
fschneider@google.com 7ea9189805 Fix null-termination bug in Stacktrace::ToCString.
Under certain conditions Stacktrace::ToCString can return
a not null-terminated string.

This is the case when ToCStringInternal is invoked with a stacktrace
of length 0.

BUG=dart:8850
TEST=tests/language/stacktrace_test.dart
Review URL: https://codereview.chromium.org//12387019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19282 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 09:03:45 +00:00

16 lines
465 B
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test that a stack trace is properly terminated (issue 8850).
void main() {
var ex = new Exception("fail");
try {
throw ex;
} on Exception catch(e, st) {
Expect.equals(ex, e);
Expect.isTrue(st.toString().endsWith("\n"));
}
}