[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is it possible to mock static functions?
- Subject: Is it possible to mock static functions?
- From: "Daniel." <danielhilst@xxxxxxxxx>
- Date: Thu, 22 Dec 2016 23:08:32 -0200
- To: cmocka@xxxxxxxxxxxxxx
Hi I have a library that I want to test using cmocka. By the way, what a wonderful project!!! That library has a static predicate function that returns true for connection and false for lack of it. There is another public write function that send data. I want to test the write function, but it checks if there is connection, returning error if not, so how can I mock the predicate to return a fake true? Is possible to mock static functions from a shared object? Regards! -- "Do or do not. There is no try" Yoda Master
|Re: Is it possible to mock static functions?||Andreas Schneider <asn@xxxxxxxxxxxxxx>|