1 extern crate backtrace
;
3 use backtrace
::Backtrace
;
5 // 50-character module name
6 mod _234567890_234567890_234567890_234567890_234567890
{
7 // 50-character struct name
8 #[allow(non_camel_case_types)]
9 pub struct _234567890_234567890_234567890_234567890_234567890
<T
>(T
);
10 impl<T
> _234567890_234567890_234567890_234567890_234567890
<T
> {
12 pub fn new() -> crate::Backtrace
{
13 crate::Backtrace
::new()
18 // Long function names must be truncated to (MAX_SYM_NAME - 1) characters.
19 // Only run this test for msvc, since gnu prints "<no info>" for all frames.
21 #[cfg(all(windows, feature = "dbghelp", target_env = "msvc"))]
22 fn test_long_fn_name() {
23 use _234567890_234567890_234567890_234567890_234567890
::_234567890_234567890_234567890_234567890_234567890
as S
;
25 // 10 repetitions of struct name, so fully qualified function name is
26 // atleast 10 * (50 + 50) * 2 = 2000 characters long.
27 // It's actually longer since it also includes `::`, `<>` and the
28 // name of the current module
29 let bt
= S
::<S
<S
<S
<S
<S
<S
<S
<S
<S
<i32>>>>>>>>>>::new();
32 let mut found_long_name_frame
= false;
34 for frame
in bt
.frames() {
35 let symbols
= frame
.symbols();
36 if symbols
.is_empty() {
40 if let Some(function_name
) = symbols
[0].name() {
41 let function_name
= function_name
.as_str().unwrap();
42 if function_name
.contains("::_234567890_234567890_234567890_234567890_234567890") {
43 found_long_name_frame
= true;
44 assert
!(function_name
.len() > 200);
49 assert
!(found_long_name_frame
);