blob: 330c034ad5f45cc4a8328a423d6b708ffadbd1ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
extern crate libloading;
#[cfg(test)]
fn assert_send<T: Send>() {}
#[cfg(test)]
fn assert_sync<T: Sync>() {}
#[cfg(test)]
fn assert_display<T: std::fmt::Display>() {}
#[test]
fn check_error_send() {
assert_send::<libloading::Error>();
}
#[test]
fn check_error_sync() {
assert_sync::<libloading::Error>();
}
#[test]
fn check_error_display() {
assert_display::<libloading::Error>();
}
#[test]
fn check_library_send() {
assert_send::<libloading::Library>();
}
#[cfg(unix)]
#[test]
fn check_unix_library_send() {
assert_send::<libloading::os::unix::Library>();
}
#[cfg(windows)]
#[test]
fn check_windows_library_send() {
assert_send::<libloading::os::windows::Library>();
}
#[test]
fn check_library_sync() {
assert_sync::<libloading::Library>();
}
#[cfg(unix)]
#[test]
fn check_unix_library_sync() {
assert_sync::<libloading::os::unix::Library>();
}
#[cfg(windows)]
#[test]
fn check_windows_library_sync() {
assert_sync::<libloading::os::windows::Library>();
}
#[test]
fn check_symbol_send() {
assert_send::<libloading::Symbol<fn() -> ()>>();
// assert_not_send::<libloading::Symbol<*const ()>>();
}
#[cfg(unix)]
#[test]
fn check_unix_symbol_send() {
assert_send::<libloading::os::unix::Symbol<fn() -> ()>>();
// assert_not_send::<libloading::os::unix::Symbol<*const ()>>();
}
#[cfg(windows)]
#[test]
fn check_windows_symbol_send() {
assert_send::<libloading::os::windows::Symbol<fn() -> ()>>();
}
#[test]
fn check_symbol_sync() {
assert_sync::<libloading::Symbol<fn() -> ()>>();
// assert_not_sync::<libloading::Symbol<*const ()>>();
}
#[cfg(unix)]
#[test]
fn check_unix_symbol_sync() {
assert_sync::<libloading::os::unix::Symbol<fn() -> ()>>();
// assert_not_sync::<libloading::os::unix::Symbol<*const ()>>();
}
#[cfg(windows)]
#[test]
fn check_windows_symbol_sync() {
assert_sync::<libloading::os::windows::Symbol<fn() -> ()>>();
// assert_not_sync::<libloading::os::windows::Symbol<*const ()>>();
}
|