Debian Codegraph @

tests/debugger_visualizer.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 #![cfg(feature = "debugger_test")]
2 #![allow(unsupported_calling_conventions)]
3 #![cfg(not(windows))]
4
5 use debugger_test::debugger_test;
6 use widestring::*;
7
8 #[inline(never)]
9 fn __break() {}
10
11 #[debugger_test(
12 debugger = "cdb",
13 commands = r#"
14 .nvlist
15 dx u16_string
16
17 dx u32_string
18
19 dx u16_cstring
20
21 dx u32_cstring
22
23 dx utf16_string
24
25 dx utf32_string
26
27 dx u16_cstr
28
29 dx u32_cstr
30 "#,
31 expected_statements = r#"
32 u16_string : "my u16 string" [Type: widestring::ustring::U16String]
33 [<Raw View>] [Type: widestring::ustring::U16String]
34 [len] : 0xd [Type: unsigned __int64]
35 [chars]
36
37 u32_string : "my u32 string" [Type: widestring::ustring::U32String]
38 [<Raw View>] [Type: widestring::ustring::U32String]
39 [len] : 0xd [Type: unsigned __int64]
40 [chars]
41
42 u16_cstring : "my u16 cstring" [Type: widestring::ucstring::U16CString]
43 [<Raw View>] [Type: widestring::ucstring::U16CString]
44 [len] : 0xf [Type: unsigned __int64]
45 [chars]
46
47 u32_cstring : "my u32 cstring" [Type: widestring::ucstring::U32CString]
48 [<Raw View>] [Type: widestring::ucstring::U32CString]
49 [len] : 0xf [Type: unsigned __int64]
50 [chars]
51
52 utf16_string : "my utf16 string" [Type: widestring::utfstring::Utf16String]
53 [<Raw View>] [Type: widestring::utfstring::Utf16String]
54 [len] : 0xf [Type: unsigned __int64]
55 [chars]
56
57 utf32_string : "my utf32 string" [Type: widestring::utfstring::Utf32String]
58 [<Raw View>] [Type: widestring::utfstring::Utf32String]
59 [len] : 0xf [Type: unsigned __int64]
60 [chars]
61
62 u16_cstr [Type: ref$<widestring::ucstr::U16CStr>]
63 pattern:\[\+0x000\] data_ptr : 0x[0-9a-f]+ : "my u16 cstr" \[Type: widestring::ucstr::U16CStr \*\]
64 [+0x008] length : 0xc [Type: unsigned __int64]
65
66 u32_cstr [Type: ref$<widestring::ucstr::U32CStr>]
67 pattern:\[\+0x000\] data_ptr : 0x[0-9a-f]+ : "my u32 cstr" \[Type: widestring::ucstr::U32CStr \*\]
68 [+0x008] length : 0xc [Type: unsigned __int64]
69 "#
70 )]
71 fn test_debugger_visualizer() {
72 let u16_string = U16String::from_str("my u16 string");
73 assert!(!u16_string.is_empty());
74
75 let u32_string = U32String::from_str("my u32 string");
76 assert!(!u32_string.is_empty());
77
78 let u16_cstring = U16CString::from_str("my u16 cstring").unwrap();
79 assert!(!u16_cstring.is_empty());
80
81 let u32_cstring = U32CString::from_str("my u32 cstring").unwrap();
82 assert!(!u32_cstring.is_empty());
83
84 let utf16_string = Utf16String::from_str("my utf16 string");
85 assert!(!utf16_string.is_empty());
86
87 let utf32_string = Utf32String::from_str("my utf32 string");
88 assert!(!utf32_string.is_empty());
89
90 let u16_cstr = u16cstr!("my u16 cstr");
91 assert!(!u16_cstr.is_empty());
92
93 let u32_cstr = u32cstr!("my u32 cstr");
94 assert!(!u32_cstr.is_empty());
95 __break(); // #break
96 }