Updating and running the component test

As you noticed, there are many commented lines in the CodeCoverage2.ptu test script.

To increase the code coverage, let's uncomment all the commented blocks in the script.

To do this, open the CodeCoverage2.ptu test script.

To uncomment multiple lines of code:

  1. Select the blocks of code.

  2. Click the red -- icon in the editor toolbar.

  3. Repeat the operation until all the commented blocks are uncommented.

  4. From the File menu, select Save to save your changes to the Unit Testing test script.

  5. From the Window menu, select Close All.

To rerun the test:

  1. In the Project Browser tab on the right-hand side of the screen, click the MyAdaTest component testing node and then click the Build toolbar button.

  2. The test has finished executing when the green execution light on the lower right of the UI stops flashing.

You should have now achieved proper code coverage.