Anonymous
10/18/2025, 8:39:57 AM
No.106926858
>>106926808
Whatever works for you. I use assertions and unit tests, assertions are my sanity checks when running debug builds and unit tests are more detailed very specific test cases for my data structure implementations and other generic stuff. You're mentioning global state, that is completely out of the scope of unit tests in my opinion, global state is something that is only present in very high level code in my projects, think about game engine update and render loops and such, nobody "unit tests" such code because that would require huge amount of mocking. You unit test low level code that depends on little to no other code except for obviously standard libraries and such which you assume to be working properly.
Whatever works for you. I use assertions and unit tests, assertions are my sanity checks when running debug builds and unit tests are more detailed very specific test cases for my data structure implementations and other generic stuff. You're mentioning global state, that is completely out of the scope of unit tests in my opinion, global state is something that is only present in very high level code in my projects, think about game engine update and render loops and such, nobody "unit tests" such code because that would require huge amount of mocking. You unit test low level code that depends on little to no other code except for obviously standard libraries and such which you assume to be working properly.