Skip to content

score/containers: Extend test cases#318

Open
crimson11 wants to merge 1 commit into
mainfrom
mf_extend_dynamic_array_tests
Open

score/containers: Extend test cases#318
crimson11 wants to merge 1 commit into
mainfrom
mf_extend_dynamic_array_tests

Conversation

@crimson11

Copy link
Copy Markdown
Contributor

Unit test have been extended to also verify
begin/end pointer dereferencing to support
bounds-checking.

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Unit test have been extended to also verify
begin/end pointer dereferencing to support
bounds-checking.
@crimson11 crimson11 force-pushed the mf_extend_dynamic_array_tests branch from f3fa393 to b7cd6b3 Compare June 29, 2026 12:01
@4og 4og requested a review from Copilot June 29, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown

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 extends the NonRelocatableVector unit tests to explicitly verify that data(), begin(), and end() exercise begin/end address resolution (via to_address / operator->()), which is important for allocator pointer types that perform bounds-checking. It also replaces the previous custom allocator mock approach with a spy-based “mockable pointer/allocator” test utility.

Changes:

  • Added MockablePointer/MockableAllocator test utilities plus a PointerSpyMock and RAII guard to record pointer-ops without altering pointer arithmetic behavior.
  • Extended non_relocatable_vector_test.cpp with new pointer-interaction tests for data(), begin(), and end().
  • Cleaned up test/build plumbing: removed the old custom_allocator_mock and updated Bazel targets; removed an unused <iostream> include.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
score/containers/test/pointer_spy_mock.h New gMock spy interface for recording pointer operations (arrow/deref/arithmetic).
score/containers/test/pointer_spy_mock.cpp TU wrapper including the new spy header for Bazel compilation.
score/containers/test/mockable_pointer.h New fancy-pointer wrapper around T* that forwards real behavior while optionally recording operations.
score/containers/test/mockable_pointer.cpp TU wrapper including the new mockable pointer header for Bazel compilation.
score/containers/test/mockable_pointer_mock_guard.h RAII helper to register/unregister the pointer spy during scoped test sections.
score/containers/test/mockable_pointer_mock_guard.cpp TU wrapper including the new guard header for Bazel compilation.
score/containers/test/mockable_allocator.h New allocator wrapper returning MockablePointer<T> to enable spy-based verification in containers.
score/containers/test/mockable_allocator.cpp Updated TU wrapper to include mockable_allocator.h.
score/containers/test/custom_allocator_mock.h Removed old allocator mock header that is no longer referenced.
score/containers/test/BUILD Replaced custom_allocator_mock library with mockable_allocator library and updated sources/headers.
score/containers/non_relocatable_vector.h Removed unused <iostream> include.
score/containers/non_relocatable_vector_test.cpp Added new tests validating begin/end address resolution via pointer-operation spying.
score/containers/dynamic_array_test.cpp Removed now-unused include and reformatted a long comment line.
score/containers/BUILD Updated test deps to drop custom_allocator_mock and add mockable_allocator where needed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@4og 4og requested a review from fbaeuerle July 3, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants