![]() |
||||||||
| |
||||||||
4Test Tips - switch StatementIndention problem can cause code to be skippedThe case clauses of a switch statement are all indented one level from the switch statement by the 4Test editor. The code for each case or default clause is also indented another level by the 4Test editor. However, the statements within these case clauses may actually have the same indentation as the line with the case keyword. These leads to a problem if you only outdent one level at the end of the last case clause. At first glance it may appear to be the continuation of the execution path for all clauses of the switch statement. Unfortunately, it is just more code in that last clause. switch
x 4Test Solution - Review the switch statements within your test scripts for proper two level outdenting where execution is to continue. A free QA Partner test script that examines other test script files in a directory (and its sub-directories) is available. Its main function is to identify all statements that will act differently due to the QAP 4.2 change in comment syntax. It also reports suspicious switch statement indention situations. Each problem is listed as a hot-link in the results file. Double clicking in the left margin of each hot-link invokes the 4test editor and positions it on the line in question. Although a "FIX" option is provided to have the script automatically indent those statements to maintain pre-4.2 behavior, the switch statements require manual use of the hot-links. (get script here)
|
||||||||
|
Send
questions or comments about this web site to: webmaster@TestMap.com |
||||||||