Skip to content

Mock unmodifiable classes - #2

Closed
EJainDev wants to merge 2 commits into
mainfrom
mock-classes
Closed

EJainDev wants to merge 2 commits into
mainfrom
mock-classes

Conversation

@EJainDev

Copy link
Copy Markdown
Owner

No description provided.

@EJainDev EJainDev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Changes requested

Comment thread include/serial_xml.cxx Outdated
Comment on lines +54 to +55
template <typename T>
inline constexpr bool has_mock_type = !std::is_void_v<typename mock_type<T>::type>;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Use a concept here

Comment thread include/serial_xml.cxx Outdated

template <std::meta::info mock_member, typename T>
requires(std::meta::is_function(mock_member))
consteval auto find_mock_function() -> std::pair<std::meta::info, std::size_t> {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I'm seeing an O(N^2) which is going to slow down compilation too much. It needs to be O(N), or ideally, if possible, O(1).

Comment thread tests/test_serial_xml.cpp Outdated
int ignored() const;
};

template <>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Make mocks be specified via annotation and not global scope.

@EJainDev EJainDev closed this Oct 9, 2026
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