We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70c267f commit 71de9dbCopy full SHA for 71de9db
src/libstd/sys/windows/os.rs
@@ -317,3 +317,17 @@ pub fn home_dir() -> Option<PathBuf> {
317
pub fn exit(code: i32) -> ! {
318
unsafe { c::ExitProcess(code as c::UINT) }
319
}
320
+
321
+#[cfg(test)]
322
+mod tests {
323
+ use io::Error;
324
+ use sys::c;
325
326
+ // tests `error_string` above
327
+ #[test]
328
+ fn ntstatus_error() {
329
+ const STATUS_UNSUCCESSFUL: u32 = 0xc000_0001;
330
+ assert!(!Error::from_raw_os_error((STATUS_UNSUCCESSFUL | c::FACILITY_NT_BIT) as _)
331
+ .to_string().contains("FormatMessageW() returned error"));
332
+ }
333
+}
0 commit comments