// // Windows NT Tape API Test : Written Sept 2, 1992 - Bob Rossi. // Copyright 1992 Archive Corporation. All rights reserved. // /** * * Unit: Windows NT API Test Code. * * Name: apitest.c * * Modified: 2/2/93. * * Description: Tests the Windows NT Tape API's. * * $LOG$ **/ #include #include #include #include #include #include #include "tapelib.h" #include "globals.h" #define TEST_ERROR TRUE #define SUCCESS FALSE // // Function Prototypes // static BOOL GetINIFile( PUINT API_Errors, LPBOOL Test_Unsupported_Features, LPDWORD Num_Test_Blocks ) ; static VOID HelpMenu ( VOID ) ; static BOOL PerformTestInitRoutines( PUINT API_Errors, LPBOOL Test_Unsupported_Features, LPDWORD Num_Test_Blocks ) ; static VOID TerminateTest( VOID ) ; static BOOL ValidSwitches( UINT argc, UCHAR *argv[], UCHAR *sw_cmdline ) ; /** * * Unit: Windows NT Tape API Test Code. * * Name: Main( ) * * Modified: 11/04/92. * * Description: 1) Checks for valid test selection options * 2) Opens tape device and performs initializations * 3) Performs selected tests * 4) Closes tape device and exits. * * Notes: - * * Returns: Standard executable return code to the OS. * * Global Data: gb_Feature_Errors * **/ VOID _CRTAPI1 main( UINT argc, UCHAR *argv[] ) { UINT API_Errors = 0 ; BOOL Test_Unsupported_Features = FALSE ; // Set default to FALSE DWORD Num_Test_Blocks = 10 ; // Set default to 10 UCHAR sw_cmdline[40] ; UINT i ; // Check command line for valid switche options. if( ValidSwitches( argc,argv,sw_cmdline ) != SUCCESS ) { return ; } // Begin testing... // All Ok, so call test initializing routines, if errors exit test. if( PerformTestInitRoutines( &API_Errors, &Test_Unsupported_Features, &Num_Test_Blocks ) ) { // 0 if successful. TerminateTest( ) ; return ; } for( i=0 ; i= 0 ) { HelpMenu( ) ; return TEST_ERROR ; } // check that all options are valid, while converting any upper case // options to lower case sw_cmdline[i] = tolower( sw_cmdline[i] ) ; while( ( sw_cmdline[i] != '\0' ) && ( FindChar( options,sw_cmdline[i] ) >= 0 ) ) { ++i ; sw_cmdline[i] = tolower( sw_cmdline[i] ) ; } // check to see if we made it to end of option string (all were valid) if( sw_cmdline[i] != '\0' ) { printf( "Unknown option '%c'.\n",sw_cmdline[i] ) ; return TEST_ERROR ; } } return SUCCESS ; }