Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在生产代码中使用弱属性以便测试代码可以覆盖函数是一种好习惯吗?
我不知道这是否是好的做法,但是有一些方法可以覆盖测试代码中不干扰生产代码的函数:
LD_PRELOAD
__weak