diff --git a/src/windows/users.rs b/src/windows/users.rs index 3c767fa9f..bc25dc817 100644 --- a/src/windows/users.rs +++ b/src/windows/users.rs @@ -56,7 +56,6 @@ impl UserInner { pub(crate) fn groups(&self) -> Vec { if let (Some(c_user_name), true) = (&self.c_user_name, self.is_local) { - // [this issue](https://github.com/GuillaumeGomez/sysinfo/issues/2222) is fixed. unsafe { get_groups_for_user(to_pcwstr(c_user_name.to_vec())) } } else { Vec::new() diff --git a/tests/users.rs b/tests/users.rs index 28abc7742..ac0cf457a 100644 --- a/tests/users.rs +++ b/tests/users.rs @@ -1,14 +1,14 @@ // Take a look at the license at the top of the repository in the LICENSE file. // This test is used to ensure that the users are not loaded by default. - +// // users.groupps() multiple times doesn't return the same output https://github.com/GuillaumeGomez/sysinfo/issues/1233 +// // Example: // ---- test_users 1 stdout ---- // user: Administrator group:[Group { inner: GroupInner { id: Gid(0), name: "Administrators" } }] // ---- test_users 2 stdout ---- // user: Administrator group:[] -// .... #[cfg(feature = "user")] #[test] fn test_users() { @@ -19,14 +19,8 @@ fn test_users() { assert_eq!(users.iter().count(), 0); users.refresh_list(); assert!(users.iter().count() > 0); - //my first gruoup is Administrator let count = users.first().unwrap().groups().iter().len(); for _ in 1..10 { - // println!( - // "user: {} group:{:?}", - // users.first().unwrap().name(), - // users.first().unwrap().groups() - // ); assert!(users.first().unwrap().groups().iter().len() == count) } }