On Thu, Sep 02, 2021 at 11:44:36AM +0300, Saulius Krasuckas wrote:
I agree. But for example when I tried to extend the LZOpenFile[AW] tests, I went for testing all combinations of wrong arguments I could imagine (still unfinished). That's because this way I could know more about the internal flow/branching of the black-boxed code.
I mean, if some questions arises about when that input pointer is handled (before other argument validation or maybe after that, or maybe at the end), the crash (and maybe additional crashes) would give some insights about the original algorithm.
Which is exactly why you should *not* write these sort of tests. We're aiming to match the functionality of the API without copying its implementation. We don't want to know about its internal branching structure.
Of course if a particular app depends on Windows returning a specific error code then thats the time to add a test for it.
Huw.