From 75ba74a21617ca78e60e35556082e68cb32aca14 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 7 Jul 2021 09:39:21 +0200 Subject: [PATCH] Tests: Build all tests on x86_64 This builds some previously-disabled tests for x86_64. --- Tests/CMakeLists.txt | 6 ++---- Tests/Kernel/fuzz-syscalls.cpp | 5 ++--- Tests/LibC/accuracy-strtod.cpp | 6 ------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index a3d245d1ae..bf5502d4d4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,8 +1,6 @@ add_subdirectory(AK) -if ("${SERENITY_ARCH}" STREQUAL "i686") - add_subdirectory(Kernel) - add_subdirectory(LibC) -endif() +add_subdirectory(Kernel) +add_subdirectory(LibC) add_subdirectory(LibCompress) add_subdirectory(LibCore) add_subdirectory(LibCpp) diff --git a/Tests/Kernel/fuzz-syscalls.cpp b/Tests/Kernel/fuzz-syscalls.cpp index 96b7c1207b..e51a39824b 100644 --- a/Tests/Kernel/fuzz-syscalls.cpp +++ b/Tests/Kernel/fuzz-syscalls.cpp @@ -85,9 +85,8 @@ static void randomize_from(size_t* buffer, size_t len, const Vector& val } } -// The largest SC_*_params struct is SC_mmap_params with 36 bytes. -static_assert(sizeof(size_t) == 4, "Cannot handle size_t != 4 bytes"); -static constexpr size_t fake_params_count = 36 / sizeof(size_t); +// The largest SC_*_params struct is SC_mmap_params with 9 size_ts (36 bytes on x86, 72 on x86_64). +static constexpr size_t fake_params_count = sizeof(Syscall::SC_mmap_params) / sizeof(size_t); static void do_weird_call(size_t attempt, int syscall_fn, size_t arg1, size_t arg2, size_t arg3, size_t* fake_params) { diff --git a/Tests/LibC/accuracy-strtod.cpp b/Tests/LibC/accuracy-strtod.cpp index b0e3a3fc99..299c64f24c 100644 --- a/Tests/LibC/accuracy-strtod.cpp +++ b/Tests/LibC/accuracy-strtod.cpp @@ -12,8 +12,6 @@ #include #include -typedef char assert_size_t_is_int[sizeof(size_t) == 4 ? 1 : -1]; - static constexpr char TEXT_ERROR[] = "\x1b[01;35m"; static constexpr char TEXT_WRONG[] = "\x1b[01;31m"; static constexpr char TEXT_OFBY1[] = "\x1b[01;97m"; @@ -328,10 +326,6 @@ static long long hex_to_ll(const char* hex) int main() { - if (sizeof(size_t) != 4) { - printf("lolwut?!\n"); - return 1; - } printf("Running %lu testcases...\n", NUM_TESTCASES); printf("%3s(%-5s): %16s(%2s) %16s(%2s) %16s(%2s) %16s(%2s) – %s\n", "num", "name", "correct", "cs", "builtin", "cs", "old_strtod", "cs", "new_strtod", "cs", "teststring");