mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-01-25 07:57:03 +00:00
FEXLinuxTests: Migrate FD test to Catch2
This commit is contained in:
parent
6610bb355c
commit
16be2792ab
@ -1,7 +1,9 @@
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
TEST_CASE("Close Range") {
|
||||
int fd_base = dup(STDOUT_FILENO);
|
||||
for (size_t i = 0; i < 15; ++i) {
|
||||
dup(fd_base);
|
||||
@ -12,6 +14,5 @@ int main() {
|
||||
::syscall(SYS_close_range, fd_base + 1, ~0U, 0);
|
||||
|
||||
// Ensure that fd_base itself wasn't closed in close_range
|
||||
int Result = close(fd_base);
|
||||
return Result;
|
||||
CHECK(close(fd_base) == 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user