-
Notifications
You must be signed in to change notification settings - Fork 56
Add more unit tests #212
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
Add more unit tests #212
Conversation
| target_compile_options ( nanobind-static PRIVATE -Wno-error=zero-length-array ) | ||
| target_compile_options ( rawtoaces_bindings PRIVATE -Wno-error=zero-length-array ) | ||
| target_compile_options ( nanobind-static PRIVATE -Wno-error=zero-length-array -Wno-zero-length-array ) | ||
| target_compile_options ( rawtoaces_bindings PRIVATE -Wno-error=zero-length-array -Wno-zero-length-array ) |
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.
without this it was giving bunch of warning for stuff coming from python binding library headers
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.
could you try if suppressing the warnings locally around the nanobind includes in rawtoaces_bindings would work?
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.
I don't know what that means, tbh. Can you expand? Don't forget, not a native c++'er here
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.
ignore that, it is minor. I may do that later separately
| { | ||
| std::cerr << "ERROR: camera needs to be initialised prior to calling " | ||
| << "SpectralSolver::calculate_WB()" << std::endl; | ||
| // TODO: Should here be return false? |
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.
@antond-weta is that on purpose? If not, I'll make a change. All other similar places (There are two more we return false)
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.
not on purpose, please fix. thanks.
|
|
||
| if ( !success ) | ||
| { | ||
| // TODO: Potentially remove, since this code path is not reachable due to camera lookup success in the previous step. |
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.
calling @antond-weta to decide if I understand that right
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.
please replace with assert(success);
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
==========================================
+ Coverage 72.56% 79.81% +7.25%
==========================================
Files 10 11 +1
Lines 2114 2150 +36
Branches 317 325 +8
==========================================
+ Hits 1534 1716 +182
+ Misses 580 434 -146
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| /// Tests that prepare_transform_spectral fails when no camera manufacturer information is available (should fail) | ||
| void test_missing_camera_manufacturer() |
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.
I was not able to change .dng we have such that it has no make 🤷 no matter what I did with exiftools, new .dng always has "DNG" as a make. Hence I couldn't make this test go through main gate like other ones.
antond-weta
left a comment
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.
looks good
| "ceres", | ||
| "nlohmann-json", | ||
| "openimageio", | ||
| { "name": "openimageio", "features": [ "libraw" ] }, |
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.
In previous windows build dependency was brought in as:
openimageio:[email protected]#1
with this change it is now
openimageio[core,libraw]:[email protected]#1
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.
Windows tests are green now.
Previously, when I was testing on local window machine the problem was that oiio I had didn't have libraw plugin enabled when I was trying to do convertion as part of a test. So, this most likely what fixed it.
cmake/modules/Findlibraw.cmake
Outdated
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.
My LLM convinced that this change is required. Though I am not 100% understrand what's going on here and I Am not convinced it is required. I feel like vcpkg.json change is where the problem was.
|
Actually it's all good seems like |
tests/test_image_converter.cpp
Outdated
|
|
||
| // Use the DNG file with camera make but no model | ||
| std::string test_file = | ||
| "../../tests/materials/blackmagic_cinema_camera_cinemadng_no_model.dng"; |
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.
Adding a 5mb image file for testing just this small use case seems a bit excessive to me. I would suggest doing this: let's skip this part in the end-to-end tests. We have a configure() method which takes an ImageSpec instead of a file path. We can try using that to modify the ImageSpec for testing purposes: load a file into an ImageBuf, grab its ImageSpec, delete the camera model atribute, feed to configure(). This way we could test all sorts of bad metadata use cases.
antond-weta
left a comment
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
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
…oduce a test utility wrapper that allow capturing of stderr buffer Signed-off-by: Aleksandr Motsjonov <[email protected]>
907750a to
9ec91f3
Compare
07036e1
into
AcademySoftwareFoundation:main
Description
Adding more tests
Checklist:
need to update the documentation, for example if this is a bug fix that
doesn't change the API.)
(adding new test cases if necessary).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.