Surgically Inserted Spy
When a system has printed output, it is usually manually inspected. Printed output can be very tedious to verify, so you probably don’t want to reinspect the output as often as you should. We will never get totally away from manually inspecting printed output, but we can eliminate the re-inspections by locking in the desired behavior.
Let’s say you already have a printf-like function to produce printed output called FormatOutput. As it is, FormatOutput is a direct function call that is in a header file with many other utilities. You would like to create a spy for FormatOutput, but you don’t want to stub out all the functions in the file containing FormatOutput. A more surgical approach is needed to intercept calls ...
Get Test Driven Development for Embedded C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.