User: Password:
|
|
Subscribe / Log in / New account

Unit testing with mock objects in C

Unit testing with mock objects in C

Posted Jul 19, 2013 7:25 UTC (Fri) by michaeljt (subscriber, #39183)
Parent article: Unit testing with mock objects in C

My problem with mock interfaces is that many interfaces do not lend themselves cleanly to being simulated. Case in point, the VirtualBox code which interacts with the X11 clipboard, which has a rather intricate communication protocol. Understanding the simulation code proved to be more work then testing manually. I am now trying the approach of wrapping those interfaces in another, higher level of interfaces more amenable to classical unit testing, and treating the code in-between them and the real ones as glue code - that is, it is not to be unit tested, but it should be simple enough that its correctness should be obvious, or at least straight forward enough that simple integration tests should show whether or not it is working without too many edge cases to consider.


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds