mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibM: Build and install the LibM test
This test seems to be full of wrong, but at least now we build it and place it in /usr/Tests/LibM/ so that we can fix it.
This commit is contained in:
parent
16a0e7a66d
commit
9d471ea923
Notes:
sideshowbarker
2024-07-18 22:35:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9d471ea923c
3 changed files with 18 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
add_subdirectory(Kernel)
|
||||
add_subdirectory(LibC)
|
||||
add_subdirectory(LibGfx)
|
||||
add_subdirectory(LibM)
|
||||
add_subdirectory(UserspaceEmulator)
|
||||
|
|
8
Userland/Tests/LibM/CMakeLists.txt
Normal file
8
Userland/Tests/LibM/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp")
|
||||
|
||||
foreach(CMD_SRC ${CMD_SOURCES})
|
||||
get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE)
|
||||
add_executable(${CMD_NAME} ${CMD_SRC})
|
||||
target_link_libraries(${CMD_NAME} LibCore)
|
||||
install(TARGETS ${CMD_NAME} RUNTIME DESTINATION usr/Tests/LibM)
|
||||
endforeach()
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -35,13 +35,13 @@
|
|||
|
||||
TEST_CASE(trig)
|
||||
{
|
||||
EXPECT_CLOSE(sin(1234), 0.653316);
|
||||
EXPECT_CLOSE(cos(1234), -0.830914);
|
||||
EXPECT_CLOSE(tan(1234), -0.786262);
|
||||
EXPECT_CLOSE(sin(1234), 0.601927);
|
||||
EXPECT_CLOSE(cos(1234), -0.798550);
|
||||
EXPECT_CLOSE(tan(1234), -0.753775);
|
||||
EXPECT_CLOSE(sqrt(1234), 35.128336)
|
||||
EXPECT_CLOSE(sin(-1), -0.867955);
|
||||
EXPECT_CLOSE(cos(-1), 0.594715);
|
||||
EXPECT_CLOSE(tan(-1), -1.459446);
|
||||
EXPECT_CLOSE(sin(-1), -0.8414709848078965);
|
||||
EXPECT_CLOSE(cos(-1), 0.5403023058681398);
|
||||
EXPECT_CLOSE(tan(-1), -1.5574077246549023);
|
||||
EXPECT(isnan(sqrt(-1)));
|
||||
EXPECT(isnan(asin(1.1)));
|
||||
EXPECT(isnan(asin(-1.1)));
|
||||
|
@ -53,7 +53,7 @@ TEST_CASE(trig)
|
|||
EXPECT_CLOSE(asin(0.5), 0.523599);
|
||||
EXPECT_CLOSE(asin(0.501), 0.524754);
|
||||
EXPECT_CLOSE(asin(0.9), 1.119770);
|
||||
EXPECT_CLOSE(asin(0.99), 1.429246);
|
||||
EXPECT_CLOSE(asin(0.99), 1.429245);
|
||||
EXPECT_CLOSE(asin(1.0), 1.570750);
|
||||
EXPECT_CLOSE(atan(0), 0.0)
|
||||
EXPECT_CLOSE(atan(0.5), 0.463648)
|
||||
|
@ -95,7 +95,7 @@ TEST_CASE(exponents)
|
|||
EXPECT_CLOSE(cosh(v.x), v.cosh);
|
||||
EXPECT_CLOSE(tanh(v.x), v.tanh);
|
||||
}
|
||||
EXPECT_EQ(exp(1000), std::numeric_limits<double>::infinity());
|
||||
EXPECT_EQ(exp(1000), __builtin_huge_val());
|
||||
}
|
||||
|
||||
TEST_CASE(logarithms)
|
Loading…
Reference in a new issue