[Category("AndroidNotWorking")] // API 21 conditionally has setgrent in the NDK headers, but bionic doesn't export it public void NonReentrantSyscalls() { var seen = new Dictionary <string, object> (); foreach (UnixGroupInfo group in UnixGroupInfo.GetLocalGroups()) { if (seen.ContainsKey(group.GroupName)) { continue; } seen.Add(group.GroupName, null); try { Group byName = Syscall.getgrnam(group.GroupName); Group byId = Syscall.getgrgid((uint)group.GroupId); Assert.IsNotNull(byName, "#TNRS: access by name"); Assert.IsNotNull(byId, "#TNRS: access by gid"); UnixGroupInfo n = new UnixGroupInfo(byName); UnixGroupInfo u = new UnixGroupInfo(byId); Assert.AreEqual(group, n, "#TNRS: construct by name"); Assert.AreEqual(group, u, "#TNRS: construct by gid"); Assert.AreEqual(n, u, "#TNRS: name == gid?"); } catch (Exception e) { Assert.Fail( string.Format("#TRC: Exception constructing UnixGroupInfo: {0}", e.ToString())); } } }
public void NonReentrantSyscalls() { foreach (UnixGroupInfo group in UnixGroupInfo.GetLocalGroups()) { try { Group byName = Syscall.getgrnam(group.GroupName); Group byId = Syscall.getgrgid((uint)group.GroupId); Assert.IsNotNull(byName, "#TNRS: access by name"); Assert.IsNotNull(byId, "#TNRS: access by gid"); UnixGroupInfo n = new UnixGroupInfo(byName); UnixGroupInfo u = new UnixGroupInfo(byId); Assert.AreEqual(group, n, "#TNRS: construct by name"); Assert.AreEqual(group, u, "#TNRS: construct by gid"); Assert.AreEqual(n, u, "#TNRS: name == gid?"); } catch (Exception e) { Assert.Fail( string.Format("#TRC: Exception constructing UnixGroupInfo: {0}", e.ToString())); } } }