ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Test functions
  • Message displayed in the status report of tests
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 23, TestVerify is kept for backward compatibility. This function is replaced by TestCheck.
Writes a result into the status report of a test according to the result of a boolean expression.
Remarks:
  • This function can only be used in the code of an automatic test.
  • To test the result of a Boolean expression on all platforms, it is also possible to use the functions dbgVerifiesXXX. For more details, see Debugging functions.
Example
// Test de validité d'adresse mail
// On suppose avoir une fonction bEmailValide qui teste la validité d'une adresse mail
// On appelle cette procédure avec des valeurs de test qui représentent des adresses valides,
// via le paramètre sAdresseEmail
// Dans le compte-rendu de test, pour chaque adresse testée apparaîtra une ligne
TestCheck(bEmailValide(sAdresseEmail), "Adresse invalide", "OK", ...
"test de validité de l'adresse mail '" + sAdresse + "': ")
 
// Pour voir uniquement les adresses invalides dans le compte-rendu de test
TestCheck(bEmailValide(sAdresseEmail), sAdresse + ": Adresse invalide")
Syntax
<Result> = TestCheck(<Boolean Expression> [, <Caption if Error> [, <Caption if Success> [, <Common Caption>]]])
<Result>: Boolean
Result of <Boolean Expression>.
<Boolean Expression>: Boolean
Expression that returns a boolean (True or False).
<Caption if Error>: Optional character string
Caption that will be displayed if <Boolean Expression> is set to False.
<Caption if Success>: Optional character string
Caption that will be displayed if <Boolean Expression> is set to True.
<Common Caption>: Optional character string
Caption that will be displayed in all cases.
Remarks

Message displayed in the status report of tests

  • If the boolean expression is set to True:
    • if the sum of <Common Caption>+<Caption if Success> is not empty, TestCheck is equivalent to:
      TestWriteResult(twrInfo, <Common Caption>+<Caption if Success>)
    • if the sum of <Common Caption>+<Caption if Success> is empty, the function has no action.
  • If the boolean expression is set to False:
    • if the sum of <Common Caption>+<Caption if Error> is not empty, TestCheck is equivalent to:
      TestWriteResult(twrError, <Common Caption>+<Caption if Error>)
    • if the sum of <Common Caption>+<Caption if Error> is empty, TestCheck is equivalent to:
      TestWriteResult(twrError, <Standard error message>)
Business / UI classification: Neutral code
Component: wd270testexe.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help