FEXLinuxTests: Migrate FD test to Catch2

This commit is contained in:
Tony Wasserka 2022-09-22 10:03:36 +02:00
parent 6610bb355c
commit 16be2792ab

View File

@ -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);
}