How to create a unit test?

Brad House brad at brad-house.com
Sun Oct 23 15:40:05 CEST 2022


c-ares uses gmock : 
https://google.github.io/googletest/gmock_for_dummies.html

So you'd have to use that framework to write unit tests.

That said, your example of src/lib/ares_android.c would be easier said 
than done as a unit test for android would actually have to run on an 
android platform, but typically when compiling for android, you are 
cross compiling and not compiling and testing natively.

On 10/23/22 5:41 AM, Nikolaos Chatzikonstantinou via c-ares wrote:
> Hello list,
>
> How can I create a unit test on git HEAD? Suppose for example I would
> like to write tests for the functions under ./src/lib/ares_android.c.
>
> Regards,
> Nikolaos Chatzikonstantinou



More information about the c-ares mailing list