Open
Conversation
7d679ff to
32d8c61
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the fault_block_layer implementation to use C++ RAII patterns and adds/updates tests to validate behavior after the refactor.
Changes:
- Introduces
make_<type>_vector(...)andmake_layer(...)helpers that returnstd::unique_ptrwith the correct deleter. - Refactors
fault_block_layerinternals fromint_vector_type/vector_typetostd::vector+std::unique_ptr. - Adds a comprehensive
fault_block_layerCatch2 test suite and updates existing layer tests to use the new helpers.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/vector_template.hpp.in | Declares make_@TYPE@_vector(...) factory returning std::unique_ptr. |
| lib/util/vector_template.cpp.in | Defines make_@TYPE@_vector(...) factory. |
| lib/include/resdata/layer.hpp | Declares make_layer(...) factory. |
| lib/resdata/layer.cpp | Defines make_layer(...). |
| lib/resdata/fault_block_layer.cpp | Refactors fault_block_layer storage/ownership to std::vector + unique_ptr. |
| lib/tests/test_layer.cpp | Updates tests to use make_layer and make_int_vector(...). |
| lib/tests/test_fault_block_layer.cpp | Adds new Catch2 tests covering fault_block_layer behaviors. |
| lib/CMakeLists.txt | Adds the new test file to the test suite target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8771fc1 to
f210aca
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f210aca to
6398268
Compare
6398268 to
78f472b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note that in particular this changes
util_abortto.at()out-of-range exceptions in some cases.