home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / os232.exe / INCLUDE / NWTEST.H < prev    next >
C/C++ Source or Header  |  1995-07-18  |  6KB  |  196 lines

  1. #ifndef _NWTEST_H
  2. #define _NWTEST_H
  3.  
  4. extern char              _userUsage[];
  5.  
  6. #ifndef INT
  7. #define INT int
  8. #endif
  9.  
  10. #ifndef INT8
  11. #define INT8 char
  12. #endif
  13.  
  14. #ifndef INT16
  15. #define INT16 short
  16. #endif
  17.  
  18. #ifndef INT32
  19. #define INT32 long
  20. #endif
  21.  
  22. #ifndef UINT
  23. #define UINT unsigned int
  24. #endif
  25.  
  26. #ifndef UINT8
  27. #define UINT8 unsigned char
  28. #endif
  29.  
  30. #ifndef UINT16
  31. #define UINT16 unsigned short
  32. #endif
  33.  
  34. #ifndef UINT32
  35. #define UINT32 unsigned long
  36. #endif
  37.  
  38. #define NWT_COUNTRY_LENGTH     (7)
  39. #define NWT_MAX_LENGTH       (512)
  40. #define NWT_MAX_LINE_LENGTH  (512)
  41. #define NWT_MAX_PATH_LENGTH  (255)
  42. #define NWT_MAX_FILE_LENGTH   (13)
  43. #ifndef TRUE
  44.    #define TRUE (1==1)
  45.    #define FALSE (!TRUE)
  46. #endif
  47.  
  48. #define NWT_SUCCESS (0L)
  49. #define NWT_FAILURE (1L)
  50.  
  51. /*
  52.  * Low byte (0x00-0xFF) used for error levels, not bit flags.
  53.  * High byte (0x100-0xFF00) used for special case bit flags.
  54.  * NWT_ALWAYS_ERROR is not required for
  55.  */
  56.  
  57. #define NWT_RETURN_ON_ERROR   0x0000   /* abort action bit off             */
  58. #define NWT_ABORT_ON_ERROR    0x0001   /* abort action bit on              */
  59.  
  60. #define NWT_OTHER_ERROR       0x0000   /* all error type bits off          */
  61. #define NWT_TEST_ERROR        0x0002   /* test error type bit on           */
  62. #define NWT_SETUP_ERROR       0x0004   /* setup error type bit on          */
  63. #define NWT_CLEANUP_ERROR     0x0008   /* cleanup error type bit on        */
  64. #define NWT_ERROR_TYPE        0x000E   /* all error bits on (for masking)  */
  65.  
  66. #define NWT_MSG_ERROR_ONLY    0x0000   /* print message bit off            */
  67. #define NWT_MSG_ALWAYS        0x0200   /* print message bit on             */
  68.  
  69. /* -----------------------------------------------------------------------
  70.  * The following only allows for backwards comp. stuff.
  71.  * -----------------------------------------------------------------------
  72.  */
  73.  
  74. # define NWT_FATAL        NWT_ABORT_ON_ERROR
  75. # define NWT_ERROR        NWT_RETURN_ON_ERROR
  76. # define NWT_ERROR_ONLY   NWT_MSG_ERROR_ONLY
  77.  
  78. /***********************************************************************
  79.  * Prototypes
  80.  ***********************************************************************
  81.  */
  82. UINT32 NWTPromptForHexArray(
  83.    const char *prompt,       /* IN; Prompt to look for */
  84.    char *userBuffer,         /* OUT; Buffer to place string when found */
  85.    UINT16   userBufferSize); /* IN; Size of userBuffer */
  86.  
  87. /*
  88.  * Find a prompt line (within the current TEST section but before the
  89.  * next section).  Returns NWT_SUCCESS on success, NWT_FAILURE on
  90.  * failure.
  91.  */
  92. UINT32 NWTPromptForString(
  93.    const char *prompt,       /* IN; Prompt to look for */
  94.    char *userBuffer,         /* OUT; Buffer to place string when found */
  95.    UINT16   userBufferSize); /* IN; Size of userBuffer */
  96.  
  97. #define NWTPromptForLong NWTPromptForUINT32
  98. #define NWTPromptForWord NWTPromptForUINT16
  99. #define NWTPromptForByte NWTPromptForUINT8
  100.  
  101. UINT32 NWTPromptForUINT32( const char *prompt, UINT32 *value );
  102. UINT32 NWTPromptForINT32(  const char *prompt,  INT32 *value );
  103. UINT32 NWTPromptForUINT16( const char *prompt, UINT16 *value );
  104. UINT32 NWTPromptForINT16(  const char *prompt,  INT16 *value );
  105. UINT32 NWTPromptForUINT8(  const char *prompt, UINT8  *value );
  106. UINT32 NWTPromptForINT8(  const char *prompt,  INT8  *value );
  107. UINT32 NWTPromptForUINT( const char *fieldName, unsigned int *value );
  108. UINT32 NWTPromptForINT( const char *fieldName, int *value );
  109.  
  110. /*
  111.  * Gets a boolean value from prompt in the curren TEST section.  Returns
  112.  * NWT_SUCCESS on success, NWT_FAILURE on failure.
  113.  */
  114. UINT32 NWTPromptForBoolean(
  115.    const char *prompt,          /* IN; Prompt to search for */
  116.    UINT8 *value);               /* OUT; Value returned if found */
  117.  
  118. /*
  119.  * Determines if the userBuffer contains the word NULL.
  120.  * This is used to allow NULL to be passed into a buffer
  121.  * without nulling out the buffer pointer.
  122.  */
  123. INT NWTIsNull( 
  124.    char *userBuffer);
  125.  
  126. /*
  127.  * Works exectly like the non-ANSI strupr() function.  Returns a 
  128.  * pointer to buffer after upper-casing each character via toupper().
  129.  */
  130. char *NWTstrupr(char *buffer);
  131.  
  132. /*
  133.  * Used just like printf to log test status messages and other
  134.  * miscellaneous information to the output file.
  135.  */
  136. void NWTLogMessage( const char *format, ... );
  137.  
  138. /*
  139.  * Prototypes for user supplied functions
  140.  */
  141. UINT32 NWTEnvInit(
  142.    void);
  143.  
  144. UINT32 NWTUserTest(
  145.    void);
  146.  
  147. UINT32 NWTEnvDeinit(
  148.    void);
  149.  
  150. UINT32 NWTReportInfo( void );
  151.  
  152. #ifdef INCLUDE_TCOMM_SUPPORT
  153.  
  154. UINT32 NWTPNWLogin(  void );
  155.  
  156. UINT32 NWTLogin(     void );
  157.  
  158. UINT32 NWTLogout(    void );
  159.  
  160. UINT32 NWTBinderyLogin(   void );
  161.  
  162. UINT32 NWTDirectoryLogin( void );
  163.  
  164. NWCONN_HANDLE NWTGetBadConnHandle( NWCONN_HANDLE connHandle );
  165. #endif
  166.  
  167. UINT32 NWTCheckResult(
  168.    UINT16  errorLevel,
  169.    const char   *message,  /* Message to display always */
  170.    UINT32  errorCode,      /* Actual error we're checking */
  171.    UINT16  validCount,     /* Number of valid error codes to follow */
  172.    ...);                   /* List of valid error codes (UINT32) */
  173.  
  174. UINT32 NWTLogError (
  175.    UINT16  errorLevel,
  176.    const char *message);   /* Message to display always */
  177.  
  178. UINT32 NWTCheckString ( 
  179.    UINT16  errorLevel,
  180.    const char   *message,  /* Message to display always */
  181.    char *actual,           /* the actual result from the API call */
  182.    char *expected );       /* the expected result from the API call */
  183.  
  184. void NWTLogBuffer (
  185.    char *pTitle,           /* Title string */
  186.    char *pBuf,             /* Buffer to dump */
  187.    INT bufLen,             /* Length of buffer */
  188.    INT colWid,             /* Number of columns to print */
  189.    INT leftMargin          /* Where to start the dump */
  190. );
  191.  
  192.  
  193.  
  194. #endif
  195.  
  196.