Closed dolfandringa closed 4 years ago
Unless you know what the function should return you are going to get all sorts of random behaviours doing that.. In that case i think you should be mocking the lib if they are compatible with FakeIt or create a a wrapper around the library and mock that.
Thanks. Yeah, I just mocked a much higher level in the mean time, preventing any of the underlying code being called. I guess I'm still getting used to doing this stuff with Fakeit/C/C++ (coming from much higher level languages)
External libraries that I am using, are calling a lot of built-in arduino functions (yield/cli/sei/pinMode/etc). I don't care about these calls, but they are resulting in
fakeit::UnexpectedMethodCallException
anyway. Is there a way to automatically justAlwaysReturn
them or something? Right now I am just debugging it by constantly running the tests, checkig the backtrace of where the tests fail, and add anAlwaysReturn
in myint main
for them. This is kind of tedious.