AutoTestDesc

Description

AutoTestDesc returns the name and description of the specified test case.

C Prototype

BOOL EXTFUN AutoTestDesc(
UWORD iTest, /* Input:  Test case number */
LPTSTR szName, /* Output:  Test case name */
LPTSTR szDesc); /* Output:  Test case description */

Arguments

iTest

The number of the test case. Test cases are numbered sequentially from 1 to the number of test cases in the auto test.

szName

The name of the test case is returned in the szName argument. This name must not exceed AUTO_MAX_TESTCASE_NAME characters.

szDesc

The description of the test case is returned in the szDesc argument. This description must not exceed AUTO_MAX_TESTDESC_NAME characters.

Return Value

TRUE if the test number was valid, the test case name is copied to szName, and the test case description is copied to szDesc. Otherwise, FALSE.

Comments

ODBC Test calls this function to determine the name and description of a test case. It displays this information when the user is selecting the test cases to run.

Code Example

The following code example shows a simple AutoTestDesc function:

#define NumCases(s) (sizeof(s) / sizeof(s[0]))

struct {
   LPSTR szName; /* Test case name    */
   LPSTR szDesc; /* Test case description */
} TestInfo[] = {
/* szName        szDesc */
/* ------------------    ------------------------*/
 "Valid connection",   "Call SQLConnect
                               normally.",
 "IM002: No DSN",    "Call SQLConnect with no
                               DSN or default.",
 "IM004: Bad SQLAllocEnv", "Make driver's SQLAllocEnv
                               fail."
};

BOOL EXTFUN AutoTestDesc(UWORD iTest, LPSTR szName, LPSTR szDesc);
{
   if (iTest > NumCases(TestInfo))
      return FALSE;
   lstrcpy(szName, TestInfo[iTest-1].szName);
   lstrcpy(szDesc, TestInfo[iTest-1].szDesc);
   return TRUE;
}