tim-balloon / TIMflight

Flight MCP repo
0 stars 0 forks source link

Write pointing unit tests #28

Closed evanmayer closed 2 years ago

evanmayer commented 2 years ago

I'm starting classes, so I won't have time to finish as many tests as I'd like to, but I want to get these in main so they don't go stale.

I'd say this is ~50% of the coverage I think is practical to get on pointing.c, but there's plenty to go on here in case someone else wants to pick up writing them, and this is also a good example of what I'd like to see more widespread in mcp.

As a bonus, it is an example of using cmocka's **state pointer to create test fixtures and pass them to test functions, a feature which I found was not well documented.

These aren't expected to build in main yet. Please continue to compile with tests off (the default). This is because the cmocka build step requires a newer CMake than our Debian Jessie Vagrant VMs have. I was able to develop tests by manually installing a newer CMake from source, and all tests are passing. I expect these tests to bear fruit after we switch to Ubuntu 20.04.