Guest User

Untitled

a guest
Aug 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Rewriting or breaking function linkage for C unit testing at compile time
  2. void a_work(void) {
  3. b_work();
  4. }
  5.  
  6. void b_work(void) {
  7. do_some_work();
  8. }
  9.  
  10. /* for test, when a_work() calls b_work() I want this to be run */
  11. void b_work(void) {
  12. if (fake_b_enabled)
  13. do_fake_b_work();
  14. else
  15. // call the real b_work() somehow
  16. }
Add Comment
Please, Sign In to add comment