Skip to content

Conversation

kairosci
Copy link

@kairosci kairosci commented Aug 23, 2025

This pull request adds support for tracking and displaying the dynamic type information of mock objects in Google Mock. The changes improve diagnostics by showing the type of the mock object when reporting errors, and provide a mechanism to register the type information for each mock object.

Enhancements to mock object diagnostics:

  • Added a new member mock_type of type const std::type_info* to the MockObjectState struct to store the dynamic type of the mock object.
  • Updated error reporting in MockObjectRegistry to display the type name of the mock object if type information is available.

API extension for type registration:

  • Introduced a new template method RegisterMockType in MockObjectRegistry to register the dynamic type information for a given mock object.

I would specify it implements FIXME in relating file.

// FIXME: Print the type of the leaked object.
// This can help the user identify the leaked object.

Copy link

google-cla bot commented Aug 23, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kairosci
Copy link
Author

I signed CLA

@kairosci kairosci force-pushed the main branch 2 times, most recently from 4a894d3 to 1c8ffd9 Compare August 23, 2025 20:20
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.

1 participant