Please enable JavaScript to view this site.

Coverage Validator Help

Navigation: Examples

Example application

Scroll Prev Top Next More

 

The example application

 

The example application is a great way to explore the capabilities of Coverage Validator.

 

The source and projects are included in the installation, but you'll need to build the example application yourself.

 

You can then use nativeExample.exe in conjunction with Coverage Validator to monitor the coverage of the application as you use it.

 

 

example-app

 

 

How to use these examples

 

The best way to understand how Coverage Validator works is by example.

 

We recommend launching the example application from Coverage Validator and observing how the menu actions affect coverage information.

 

Examining the source code is the best way to see what's going on in the example application.

 

Resetting the statistics before and between using the menu items is a good way to easily see exactly what new code was executed and marked as included in the coverage.

 

For convenience, below we have provided the source locations where each menu action runs a test.

 

Most test locations are in the CTeststakView class of nativeExample\TESTSVW.CPP

 

 

File menu

 

menu File menu instructionStep Exit instructionStep closes the example application, which itself increases the code coverage.
 

 

Test menu

 

menu Test menu instructionStep ...

 

instructionStep Test

OnTestPerformtest()

Calls a small number of test functions

instructionStep Test2

OnTestTest2()

Calls a small number of other test functions

instructionStep LoadLibrary Test...

OnCommandLoadLibrary()

Opens a file browser for you to choose a test dll to load but doesn't call any other functions

instructionStep FreeLibrary Test

OnCommandFreeLibrary()

Frees up any previously loaded library above

 

 

Colour menu

 

menu Colour menu instructionStep ...

 

instructionStep Red, Green, Blue,
   Cyan, Magenta, Yellow

OnColourRed(), OnColourGreen(), etc

Sets the background colour of the main window and repaints the window

instructionStep Reset

OnColourReset()

Calls the same method that accesses two more different methods

instructionStep Use if() statements

OnColourUseifstatements()

Affects the code path used when applying the background colours above

instructionStep Use switch() statements

OnColourUseswitchstatements()

Affects the code path used when applying background colours

 

 

Help menu

 

menu Help menu instructionStep ...

 

instructionStep About Coverage Validator Tester...

CTeststakApp::OnAppAbout(), etc

Shows a simple help dialog using code in nativeExample.cpp