Setting Up the Environment

The ITest::setup function allows you to prepare for your test before calling the ITest::test function. Override setup to specify any special conditions that the test requires. A common activity to handle during setup is to parse command-line arguments that you can pass into a test.

The Test Framework provides the cleanup function, which you can use to perform any necessary cleanup after your test finishes. You need to override cleanup to restore the system to its previous state by undoing any actions, such as storage allocation, performed within setup that affect the state of the system. The cleanup function is executed even if a software exception occurs. If a hardware exception occurs in the ITest function, such as a bus error, then cleanup is not called.