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 >
Wrap
C/C++ Source or Header
|
1995-07-18
|
6KB
|
196 lines
#ifndef _NWTEST_H
#define _NWTEST_H
extern char _userUsage[];
#ifndef INT
#define INT int
#endif
#ifndef INT8
#define INT8 char
#endif
#ifndef INT16
#define INT16 short
#endif
#ifndef INT32
#define INT32 long
#endif
#ifndef UINT
#define UINT unsigned int
#endif
#ifndef UINT8
#define UINT8 unsigned char
#endif
#ifndef UINT16
#define UINT16 unsigned short
#endif
#ifndef UINT32
#define UINT32 unsigned long
#endif
#define NWT_COUNTRY_LENGTH (7)
#define NWT_MAX_LENGTH (512)
#define NWT_MAX_LINE_LENGTH (512)
#define NWT_MAX_PATH_LENGTH (255)
#define NWT_MAX_FILE_LENGTH (13)
#ifndef TRUE
#define TRUE (1==1)
#define FALSE (!TRUE)
#endif
#define NWT_SUCCESS (0L)
#define NWT_FAILURE (1L)
/*
* Low byte (0x00-0xFF) used for error levels, not bit flags.
* High byte (0x100-0xFF00) used for special case bit flags.
* NWT_ALWAYS_ERROR is not required for
*/
#define NWT_RETURN_ON_ERROR 0x0000 /* abort action bit off */
#define NWT_ABORT_ON_ERROR 0x0001 /* abort action bit on */
#define NWT_OTHER_ERROR 0x0000 /* all error type bits off */
#define NWT_TEST_ERROR 0x0002 /* test error type bit on */
#define NWT_SETUP_ERROR 0x0004 /* setup error type bit on */
#define NWT_CLEANUP_ERROR 0x0008 /* cleanup error type bit on */
#define NWT_ERROR_TYPE 0x000E /* all error bits on (for masking) */
#define NWT_MSG_ERROR_ONLY 0x0000 /* print message bit off */
#define NWT_MSG_ALWAYS 0x0200 /* print message bit on */
/* -----------------------------------------------------------------------
* The following only allows for backwards comp. stuff.
* -----------------------------------------------------------------------
*/
# define NWT_FATAL NWT_ABORT_ON_ERROR
# define NWT_ERROR NWT_RETURN_ON_ERROR
# define NWT_ERROR_ONLY NWT_MSG_ERROR_ONLY
/***********************************************************************
* Prototypes
***********************************************************************
*/
UINT32 NWTPromptForHexArray(
const char *prompt, /* IN; Prompt to look for */
char *userBuffer, /* OUT; Buffer to place string when found */
UINT16 userBufferSize); /* IN; Size of userBuffer */
/*
* Find a prompt line (within the current TEST section but before the
* next section). Returns NWT_SUCCESS on success, NWT_FAILURE on
* failure.
*/
UINT32 NWTPromptForString(
const char *prompt, /* IN; Prompt to look for */
char *userBuffer, /* OUT; Buffer to place string when found */
UINT16 userBufferSize); /* IN; Size of userBuffer */
#define NWTPromptForLong NWTPromptForUINT32
#define NWTPromptForWord NWTPromptForUINT16
#define NWTPromptForByte NWTPromptForUINT8
UINT32 NWTPromptForUINT32( const char *prompt, UINT32 *value );
UINT32 NWTPromptForINT32( const char *prompt, INT32 *value );
UINT32 NWTPromptForUINT16( const char *prompt, UINT16 *value );
UINT32 NWTPromptForINT16( const char *prompt, INT16 *value );
UINT32 NWTPromptForUINT8( const char *prompt, UINT8 *value );
UINT32 NWTPromptForINT8( const char *prompt, INT8 *value );
UINT32 NWTPromptForUINT( const char *fieldName, unsigned int *value );
UINT32 NWTPromptForINT( const char *fieldName, int *value );
/*
* Gets a boolean value from prompt in the curren TEST section. Returns
* NWT_SUCCESS on success, NWT_FAILURE on failure.
*/
UINT32 NWTPromptForBoolean(
const char *prompt, /* IN; Prompt to search for */
UINT8 *value); /* OUT; Value returned if found */
/*
* Determines if the userBuffer contains the word NULL.
* This is used to allow NULL to be passed into a buffer
* without nulling out the buffer pointer.
*/
INT NWTIsNull(
char *userBuffer);
/*
* Works exectly like the non-ANSI strupr() function. Returns a
* pointer to buffer after upper-casing each character via toupper().
*/
char *NWTstrupr(char *buffer);
/*
* Used just like printf to log test status messages and other
* miscellaneous information to the output file.
*/
void NWTLogMessage( const char *format, ... );
/*
* Prototypes for user supplied functions
*/
UINT32 NWTEnvInit(
void);
UINT32 NWTUserTest(
void);
UINT32 NWTEnvDeinit(
void);
UINT32 NWTReportInfo( void );
#ifdef INCLUDE_TCOMM_SUPPORT
UINT32 NWTPNWLogin( void );
UINT32 NWTLogin( void );
UINT32 NWTLogout( void );
UINT32 NWTBinderyLogin( void );
UINT32 NWTDirectoryLogin( void );
NWCONN_HANDLE NWTGetBadConnHandle( NWCONN_HANDLE connHandle );
#endif
UINT32 NWTCheckResult(
UINT16 errorLevel,
const char *message, /* Message to display always */
UINT32 errorCode, /* Actual error we're checking */
UINT16 validCount, /* Number of valid error codes to follow */
...); /* List of valid error codes (UINT32) */
UINT32 NWTLogError (
UINT16 errorLevel,
const char *message); /* Message to display always */
UINT32 NWTCheckString (
UINT16 errorLevel,
const char *message, /* Message to display always */
char *actual, /* the actual result from the API call */
char *expected ); /* the expected result from the API call */
void NWTLogBuffer (
char *pTitle, /* Title string */
char *pBuf, /* Buffer to dump */
INT bufLen, /* Length of buffer */
INT colWid, /* Number of columns to print */
INT leftMargin /* Where to start the dump */
);
#endif