aboutsummaryrefslogtreecommitdiff
path: root/vendor/backtrace/tests/long_fn_name.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
committerValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
commita990de90fe41456a23e58bd087d2f107d321f3a1 (patch)
tree15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/backtrace/tests/long_fn_name.rs
parent3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff)
downloadfparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz
fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip
Deleted vendor folder
Diffstat (limited to 'vendor/backtrace/tests/long_fn_name.rs')
-rw-r--r--vendor/backtrace/tests/long_fn_name.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/vendor/backtrace/tests/long_fn_name.rs b/vendor/backtrace/tests/long_fn_name.rs
deleted file mode 100644
index fa4cfda..0000000
--- a/vendor/backtrace/tests/long_fn_name.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-use backtrace::Backtrace;
-
-// 50-character module name
-mod _234567890_234567890_234567890_234567890_234567890 {
- // 50-character struct name
- #[allow(non_camel_case_types)]
- pub struct _234567890_234567890_234567890_234567890_234567890<T>(T);
- impl<T> _234567890_234567890_234567890_234567890_234567890<T> {
- #[allow(dead_code)]
- pub fn new() -> crate::Backtrace {
- crate::Backtrace::new()
- }
- }
-}
-
-// Long function names must be truncated to (MAX_SYM_NAME - 1) characters.
-// Only run this test for msvc, since gnu prints "<no info>" for all frames.
-#[test]
-#[cfg(all(windows, target_env = "msvc"))]
-fn test_long_fn_name() {
- use _234567890_234567890_234567890_234567890_234567890::_234567890_234567890_234567890_234567890_234567890 as S;
-
- // 10 repetitions of struct name, so fully qualified function name is
- // atleast 10 * (50 + 50) * 2 = 2000 characters long.
- // It's actually longer since it also includes `::`, `<>` and the
- // name of the current module
- let bt = S::<S<S<S<S<S<S<S<S<S<i32>>>>>>>>>>::new();
- println!("{:?}", bt);
-
- let mut found_long_name_frame = false;
-
- for frame in bt.frames() {
- let symbols = frame.symbols();
- if symbols.is_empty() {
- continue;
- }
-
- if let Some(function_name) = symbols[0].name() {
- let function_name = function_name.as_str().unwrap();
- if function_name.contains("::_234567890_234567890_234567890_234567890_234567890") {
- found_long_name_frame = true;
- assert!(function_name.len() > 200);
- }
- }
- }
-
- assert!(found_long_name_frame);
-}