Yes, this is a silly test. Not sure of an actual way to test this code.

As for the use of this code in tests -- all tests should pass in production mode, but not all tests are useful in production mode. So you can use this to ensure particular tests are run in checked mode. Yes, it's a hack. It would be nicer to have a way to enforce that a test is run in both production and checked mode. Somehow...