|
|
|
|
|
by virgilp
3077 days ago
|
|
> a complex method that you feel can be explained in documentation yet not in tests, I'm happy to take a crack at writing the tests. // This implementation is unnatural but it is needed in order to mitigate a hardware bug on TI Sitara AM437x, see http://some.url (that's an obvious one; but there are plenty of other cases where documentation is easier than a test) |
|
One way to implement this is by using two methods: one normal and one with the hardware mitigation code, with a dispatch that chooses between them.
This separation of concerns ensures that your normal code runs normally on normal hardware, and your specialized code runs in a specialized way on the buggy hardware.
This separation also makes it much clearer/easier to end-of-life the mitigation code when it's time.