Skip to main content

Module mock_function

Module mock_function 

Source
Expand description

Function mocking utilities

Provides runtime support for mocking global functions.

Note: Full function mocking requires unsafe code for runtime function replacement. This module provides a safe framework using function pointers.

Structs§

MockRegistry
Mock registry for tracking mocked functions

Functions§

clear_all_mocks
Clear all mocks
clear_mock
Clear a specific mock
get_mock
Get a mocked function
is_mocked
Check if a function is mocked
mock_function
Mock a function with a closure
with_mock
Run a function with a temporary mock