Skip to content

Refactor fault block layer.cpp#1131

Open
eivindjahren wants to merge 11 commits intomainfrom
refactor_fault_block_layer.cpp
Open

Refactor fault block layer.cpp#1131
eivindjahren wants to merge 11 commits intomainfrom
refactor_fault_block_layer.cpp

Conversation

@eivindjahren
Copy link
Collaborator

@eivindjahren eivindjahren commented Mar 3, 2026

Note that in particular this changes util_abort to .at() out-of-range exceptions in some cases.

@eivindjahren eivindjahren force-pushed the refactor_fault_block_layer.cpp branch 3 times, most recently from 7d679ff to 32d8c61 Compare March 4, 2026 13:59
@eivindjahren eivindjahren requested a review from Copilot March 5, 2026 07:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...) and make_layer(...) helpers that return std::unique_ptr with the correct deleter.
  • Refactors fault_block_layer internals from int_vector_type/vector_type to std::vector + std::unique_ptr.
  • Adds a comprehensive fault_block_layer Catch2 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.

@eivindjahren eivindjahren force-pushed the refactor_fault_block_layer.cpp branch 4 times, most recently from 8771fc1 to f210aca Compare March 6, 2026 08:36
@eivindjahren eivindjahren requested a review from Copilot March 6, 2026 08:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eivindjahren eivindjahren force-pushed the refactor_fault_block_layer.cpp branch from f210aca to 6398268 Compare March 6, 2026 09:45
@eivindjahren eivindjahren force-pushed the refactor_fault_block_layer.cpp branch from 6398268 to 78f472b Compare March 6, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants