Runtime warnings
Jul. 28th, 2018 12:10 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
The other thought that inspired the previous post is that I didn't have a good concept in my mind for a sort of assert I want sometimes, of something I don't expect to usually happen, or don't expect to happen in testing, even if it may happen in other scenarios.
Say "unrecognised parameter in config file" as exhibited in some bug in a computer game that turned off a lot of the ai for many of the enemies that people were talking about recently.
Or "needed to retry file access/memory allocation/etc". Or "input file size is more than 1Gb".
You don't necessarily want to treat those as failures, because they might happen in real life and if so, you want to deal with them. You don't want to stop the function at the point where they occur. But you sort of want to mark the behaviour somehow, because it will *usually* indicate a bug while developing.
I'm not sure how to think of these. Maybe "development only asserts"? Or "warnings which are not triggered, but counted and printed out at program termination during development and included with output of tests"?
Say "unrecognised parameter in config file" as exhibited in some bug in a computer game that turned off a lot of the ai for many of the enemies that people were talking about recently.
Or "needed to retry file access/memory allocation/etc". Or "input file size is more than 1Gb".
You don't necessarily want to treat those as failures, because they might happen in real life and if so, you want to deal with them. You don't want to stop the function at the point where they occur. But you sort of want to mark the behaviour somehow, because it will *usually* indicate a bug while developing.
I'm not sure how to think of these. Maybe "development only asserts"? Or "warnings which are not triggered, but counted and printed out at program termination during development and included with output of tests"?