testing - Is it bad practice to use the weak attribute to write test code in c? -
is practice use weak attribute in production code test code 1 can override functions?
i don't know if good practice, there ways override functions in test code not interfere production code:
- using macros redefine function names wish override
- using
ld_preload
- using macros expand
__weak
in debug mode , nothing in production mode.
Comments
Post a Comment