-
Notifications
You must be signed in to change notification settings - Fork 19
libc math test minor changes #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @adamdebek, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on a significant refactoring and enhancement of the libc/math
test suite. The changes aim to improve the clarity, consistency, and robustness of existing tests by introducing specialized assertion macros for floating-point comparisons, standardizing test naming conventions, and enabling more comprehensive checks for edge cases and error conditions. It also includes minor refactorings of test utility functions.
Highlights
- Test Infrastructure Improvement: Introduced new, more precise assertion macros (
TEST_ASSERT_DOUBLE_IS_ZERO
,TEST_ASSERT_DOUBLE_IS_NEG_ZERO
,TEST_ASSERT_DOUBLE_IS_INF
,TEST_ASSERT_DOUBLE_IS_NEG_INF
) for double-precision floating-point comparisons in test cases, defined inlibc/math/common.h
. - Test Suite Refactoring: Standardized test case naming conventions by renaming numerous tests from
*_special_cond
to*_special_val
acrosslibc/math/abs.c
,libc/math/exp.c
,libc/math/frac.c
,libc/math/pow.c
, andlibc/math/trig.c
for improved clarity and consistency. - Enhanced Test Coverage: Enabled and corrected previously commented-out test cases, particularly for special floating-point values (NaN, Infinity, Zero) and error handling (
errno
), significantly improving test coverage for various mathematical functions includingfabs
,exp
,frexp
,ldexp
,log
,log2
,log10
,modf
,fmod
,ceil
,floor
,sqrt
,pow
,sin
,cos
,tan
,asin
,acos
,atan
,atan2
,sinh
,cosh
, andtanh
. - Test Utility Refinement: Refactored the
test_checkResult
function logic inlibc/math/common.c
and updated parameter types intest_check_digLost
andtest_check_digLost2
fromdouble
toint
for better type accuracy and test utility.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request significantly improves the math library's test suite by refactoring test cases for better clarity, enabling a large number of previously disabled tests for special floating-point values, and introducing more specific assertion macros. These are all great changes that enhance test quality. I've identified a few minor issues, including a potential bug in an error calculation function, some opportunities to improve test coverage and correctness, and a couple of instances of duplicated test code. My detailed comments are provided to help address these points.
7f8e56e
to
3cc0fe0
Compare
Armv8m33-mcxn94x-frdm required a little bit lower precision what is acceptable. I added also minor variable type changes and typo fix. JIRA: CI-565
3cc0fe0
to
b3a3e3b
Compare
Unit Test Results8 201 tests ±0 7 573 ✅ - 104 41m 59s ⏱️ +34s For more details on these failures, see this check. Results for commit a20bc11. ± Comparison against base commit 2a9738b. This pull request removes 207 and adds 207 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
JIRA: CI-565
b3a3e3b
to
a20bc11
Compare
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment