Skip to content

Commit

Permalink
Add a regression test for user and group ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Linz committed Dec 17, 2020
1 parent f1c40ba commit e885958
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/std/os/linux/test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const linux = std.os.linux;
const mem = std.mem;
const elf = std.elf;
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const fs = std.fs;

test "fallocate" {
Expand Down Expand Up @@ -99,3 +100,10 @@ test "statx" {
expect(@bitCast(u64, @as(i64, stat_buf.blksize)) == statx_buf.blksize);
expect(@bitCast(u64, @as(i64, stat_buf.blocks)) == statx_buf.blocks);
}

test "user and group ids" {
expectEqual(getauxval(AT_UID), getuid());
expectEqual(getauxval(AT_GID), getgid());
expectEqual(getauxval(AT_EUID), geteuid());
expectEqual(getauxval(AT_EGID), getegid());
}

0 comments on commit e885958

Please sign in to comment.