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

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -