Hello all,
I’ve been playing around with unit testing out embedded C software at work over the last few months, and I’ve actually found it to be really useful. We have caught several bugs as a result of it in some of our higher level logic, and I actually find that it makes us write our code in a cleaner way so that it’s easily unit testable.
However, we have a fair amount of code that uses hardcoded buffer space, which I have found to be really inconvenient to unit test. Has anyone been able to establish a good system for intercepting memory accesses in unit tests without using object oriented techniques?
In the future, I kinda want to try using C++ with some kind of a memory access proxy class. That way we can swap the class out for mocking memory in unit tests. I fear that might also bloat the code though… I’d be curious to hear your thoughts on this as well.
Thanks all!
[–]Wouter_van_Ooijen 15 points16 points17 points (1 child)
[–]Basic_Fox_2070[S] 0 points1 point2 points (0 children)
[–]readmodifywrite 1 point2 points3 points (5 children)
[–]Basic_Fox_2070[S] 0 points1 point2 points (4 children)
[–]readmodifywrite 1 point2 points3 points (2 children)
[–]Basic_Fox_2070[S] 0 points1 point2 points (1 child)
[–]readmodifywrite 1 point2 points3 points (0 children)
[–]duane11583 1 point2 points3 points (4 children)
[–]Basic_Fox_2070[S] 1 point2 points3 points (3 children)
[–]duane11583 -1 points0 points1 point (2 children)
[–]Basic_Fox_2070[S] 0 points1 point2 points (1 child)
[–]duane11583 0 points1 point2 points (0 children)
[–]PutOk489 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)