-
Notifications
You must be signed in to change notification settings - Fork 10
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
23: Breaks up nearest tests to not be singular test #43
Conversation
I saw this project and thought it was very well documented and heavily tested! I wanted to use this PR as an introduction and to see if changes like this for the tests are okay! I saw your card #23 . If these changes look okay, I would love to look into the other ones and format them similarly. |
Hello! Firstly, thank you for taking the time to create a PR for ccmath! Overall, these changes are perfectly acceptable the only request I would have is that somewhere in the test we perform a |
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.
All that is required at the moment would be to add a static_assert to both of these test cases to ensure our functions work at compile time. Besides lgtm!
fba76e5
to
11ef23d
Compare
I tried giving this a good tackle and think I stumbled upon an issue. I noticed when I added the tests for compile time assertions, the https://github.com/Rinzii/ccmath/actions/runs/9848897543/job/27191697093#step:5:82 It seems like there is an improper type being passed into In the most recent push, I commented out the internals of the test with the What are you thoughts on this? |
11ef23d
to
8a42dd0
Compare
Sorry I‘ve been having a lot of IRL stuff going on recently and have not had much time to look at my GitHub. Is this issue still persisting? |
No problem. Yes, the issue still is persisting. I have been trying to build using clang on Ubuntu locally, however I was getting other build errors before this one. In the current commit, I have commented out the compile time test I added for If this sounds like an okay plan, I leave commented out compile time test here and have a card to address this properly in the future? |
Hmmm I’ll investigate this issue myself locally in a few days. I’ll see if I can identify what the problem may be. :) |
Ok, after looking into this it appears the issue is because of specific implementation details of how |
8a42dd0
to
e02a166
Compare
Tests modified: - floor_test.cpp - trunc_test.cpp Both adopts parameterized tests. These help reduce the expect calls and code duplication, also making it easier to add additional test cases in the future. NaN tests are still inside of the original TEST function. Since the tests seemed to be directly comparing the function under test with the standard library equivalent, adjusted the `std::signbit` and `std::isnan` comparisons to directly compare equality in the NaN tests.
e02a166
to
823605a
Compare
Sounds good! I updated the code. I added a macro to the cpp file here: https://github.com/Rinzii/ccmath/pull/43/files#diff-0ad15176bfaf60d1dd519b442c7412c099c1d2425808bd30e4823cf9ddd4722bR17 Since clang linux was the only one failing, I made sure to check the compiler was clang and the os was linux. I then undefined it at the end of the source file to try and reduce the scope of the macro to be just that test file. |
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.
lgtm!
Tests modified:
Both adopts parameterized tests. These help reduce the expect calls and code duplication, also making it easier to add additional test cases in the future. NaN tests are still inside of the original TEST function.
Since the tests seemed to be directly comparing the function under test with the standard library equivalent, adjusted the
std::signbit
andstd::isnan
comparisons to directly compare equality in the NaN tests.I also made sure to run the
clang-format
on the files that were modified.