Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ystdlib/wrapped_facade_headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ cpp_library(
PUBLIC_HEADERS
sys/types.h
TESTS_SOURCES
test/test_off_t.cpp
test/test_sys_types.cpp
)
7 changes: 6 additions & 1 deletion src/ystdlib/wrapped_facade_headers/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
#include <sys/types.h>

#if defined(__APPLE__)
#include <sys/_types/_off_t.h>
#include <sys/_types/_u_char.h>
#include <sys/_types/_u_short.h>
#include <sys/_types/_u_int.h>
#include <sys/_types/_quad_t.h>
#include <sys/_types/_u_quad_t.h>
#include <sys/_types/_fsid_t.h>
#endif
// IWYU pragma: end_exports
// clang-format on
10 changes: 0 additions & 10 deletions src/ystdlib/wrapped_facade_headers/test/test_off_t.cpp

This file was deleted.

48 changes: 48 additions & 0 deletions src/ystdlib/wrapped_facade_headers/test/test_sys_types.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <ystdlib/wrapped_facade_headers/sys/types.h>

#include <catch2/catch_test_macros.hpp>

namespace ystdlib::wrapped_facade_headers::test {
TEST_CASE("test_sys_types_u_char", "[wrapped_facade_headers][sys_types][u_char]") {
u_char const i{0};
REQUIRE(0 == i);
}

TEST_CASE("test_sys_types_u_short", "[wrapped_facade_headers][sys_types][u_short]") {
u_short const i{0};
REQUIRE(0 == i);
}

TEST_CASE("test_sys_types_u_int", "[wrapped_facade_headers][sys_types][u_int]") {
u_int const i{0};
REQUIRE(0 == i);
}

TEST_CASE("test_sys_types_u_long", "[wrapped_facade_headers][sys_types][u_long]") {
u_long const i{0};
REQUIRE(0 == i);
}

TEST_CASE("test_sys_types_quad_t", "[wrapped_facade_headers][sys_types][quad_t]") {
quad_t const i{0};
REQUIRE(0 == i);
}

TEST_CASE("test_sys_types_u_quad_t", "[wrapped_facade_headers][sys_types][u_quad_t]") {
u_quad_t const i{0};
REQUIRE(0 == i);
}

TEST_CASE("test_sys_types_fsid_t", "[wrapped_facade_headers][sys_types][fsid_t]") {
fsid_t const i{{0, 0}};
REQUIRE(0 == i.__val[0]);
REQUIRE(0 == i.__val[1]);
}

#if defined(__linux__)
TEST_CASE("test_sys_types_loff_t", "[wrapped_facade_headers][sys_types][loff_t]") {
loff_t const i{0};
REQUIRE(0 == i);
}
#endif
} // namespace ystdlib::wrapped_facade_headers::test
Loading