diff --git a/flaim/Makefile b/flaim/Makefile index e2d4b60..0df3dfd 100644 --- a/flaim/Makefile +++ b/flaim/Makefile @@ -1137,6 +1137,7 @@ ifdef netware_target $(ec)$(gprintf) "option start = f_nlmEntryPoint\n" >> $(4) $(ec)$(gprintf) "option exit = f_nlmExitPoint\n" >> $(4) $(ec)$(gprintf) "option nodefaultlibs\n" >> $(4) + $(ec)$(gprintf) "option xdcdata=nlm.xdc\n" >> $(4) $(ec)$(gprintf) "option pseudopreemption\n" >> $(4) $(ec)$(gprintf) "debug all debug novell\n" >> $(4) $(ec)$(gprintf) "form novell nlm '$(2)'\n" >> $(4) @@ -1172,6 +1173,7 @@ ifdef netware_target $(ec)$(gprintf) "option start = _LibCPrelude\n" >> $(4) $(ec)$(gprintf) "option exit = _LibCPostlude\n" >> $(4) $(ec)$(gprintf) "option nodefaultlibs\n" >> $(4) + $(ec)$(gprintf) "option xdcdata=nlm.xdc\n" >> $(4) $(ec)$(gprintf) "option pseudopreemption\n" >> $(4) $(ec)$(gprintf) "debug all debug novell\n" >> $(4) $(ec)$(gprintf) "form novell nlm '$(2)'\n" >> $(4) @@ -1258,7 +1260,6 @@ ifdef netware_target $(ec)$(gprintf) "import kMutexFree\n" >> $(1) $(ec)$(gprintf) "import kMutexLock\n" >> $(1) $(ec)$(gprintf) "import kMutexUnlock\n" >> $(1) - $(ec)$(gprintf) "import kQueCount\n" >> $(1) $(ec)$(gprintf) "import kReturnCurrentProcessorID\n" >> $(1) $(ec)$(gprintf) "import kScheduleThread\n" >> $(1) $(ec)$(gprintf) "import kSemaphoreAlloc\n" >> $(1) @@ -1302,14 +1303,12 @@ ifdef netware_target $(ec)$(gprintf) "import SetFileSize\n" >> $(1) $(ec)$(gprintf) "import SGUIDCreate\n" >> $(1) $(ec)$(gprintf) "import SizeOfAllocBlock\n" >> $(1) - $(ec)$(gprintf) "import StopBell\n" >> $(1) $(ec)$(gprintf) "import SwitchToDirectFileMode\n" >> $(1) $(ec)$(gprintf) "import SwitchToDirectFileMode\n" >> $(1) $(ec)$(gprintf) "import UngetKey\n" >> $(1) $(ec)$(gprintf) "import UnImportPublicSymbol\n" >> $(1) $(ec)$(gprintf) "import UnloadRules\n" >> $(1) $(ec)$(gprintf) "import VMGetDirectoryEntry\n" >> $(1) - $(ec)$(gprintf) "import WorkToDoListHead\n" >> $(1) $(ec)$(gprintf) "import WriteFile\n" >> $(1) $(ec)$(gprintf) "import WS2_32_bind\n" >> $(1) $(ec)$(gprintf) "import WS2_32_closesocket\n" >> $(1) diff --git a/flaim/util/basic_test.cpp b/flaim/util/basic_test.cpp index 4cb2444..83e19ac 100644 --- a/flaim/util/basic_test.cpp +++ b/flaim/util/basic_test.cpp @@ -51,12 +51,12 @@ FSTATIC const char * gv_pszSampleDictionary = #define LAST_NAME_FIRST_NAME_IX 100 #ifdef FLM_NLM - #define DB_NAME_STR "SYS:\\SAMPLE.DB" - #define DB_COPY_NAME_STR "SYS:\\SAMPLECOPY.DB" - #define DB_RENAME_NAME_STR "SYS:\\SAMPLERENAME.DB" - #define DB_RESTORE_NAME_STR "SYS:\\SAMPLERESTORE.DB" - #define DB_REBUILD_NAME_STR "SYS:\\SAMPLEREBUILD.DB" - #define BACKUP_PATH "SYS:\\SAMPLEBACKUP" + #define DB_NAME_STR "SYS:\\TEST\\SAMPLE.DB" + #define DB_COPY_NAME_STR "SYS:\\TEST\\SAMPLECOPY.DB" + #define DB_RENAME_NAME_STR "SYS:\\TEST\\SAMPLERENAME.DB" + #define DB_RESTORE_NAME_STR "SYS:\\TEST\\SAMPLERESTORE.DB" + #define DB_REBUILD_NAME_STR "SYS:\\TEST\\SAMPLEREBUILD.DB" + #define BACKUP_PATH "SYS:\\TEST\\SAMPLEBACKUP" #else #define DB_NAME_STR "sample.db" #define DB_COPY_NAME_STR "samplecopy.db" @@ -2166,6 +2166,8 @@ RCODE IFlmTestImpl::resumeIndexTest( { break; } + + f_yieldCPU(); } bPassed = TRUE; @@ -2339,8 +2341,12 @@ RCODE IFlmTestImpl::sortedFieldsTest( goto Exit; } } + + f_yieldCPU(); } } + + f_yieldCPU(); } // Add the data record to the data container. @@ -2454,7 +2460,11 @@ RCODE IFlmTestImpl::sortedFieldsTest( goto Exit; } } + + f_yieldCPU(); } + + f_yieldCPU(); } // For each of the 300 field ids, get the field from the record. @@ -2529,6 +2539,8 @@ RCODE IFlmTestImpl::sortedFieldsTest( (unsigned)uiFieldId); goto Exit; } + + f_yieldCPU(); } bPassed = TRUE; diff --git a/flaim/util/flmunittest.cpp b/flaim/util/flmunittest.cpp index 729f004..ae8bf9a 100644 --- a/flaim/util/flmunittest.cpp +++ b/flaim/util/flmunittest.cpp @@ -27,16 +27,9 @@ extern RCODE getTest( IFlmTest ** ppTest); - -#ifdef FLM_NLM - extern "C" - { - void flmUnittestFatalRuntimeError( void); - int flmUnittestLoad( void); - - int flmUnittestUnload( void); - } +#ifndef FLM_NLM + #define f_conPrintf f_printf #endif FLMBOOL gv_bShutdown = FALSE; @@ -175,12 +168,7 @@ Desc: void IFlmTestDisplayer::appendString( const char * pszString) { -#ifdef FLM_NLM - F_UNREFERENCED_PARM( pszString); -#else - printf( pszString); - fflush( stdout); -#endif + f_conPrintf( pszString); } /**************************************************************************** @@ -188,21 +176,19 @@ Desc: ****************************************************************************/ void printHelp() { -#ifndef FLM_NLM - printf( "\nCommand-line usage:"); - printf( "\n\n[-l] [-d]"); - printf( "[-c] [-b] [-u]"); - printf( "\n-l - Specifies a log file to print to"); - printf( "\n-d - Display output"); - printf( "\n-t - Specifies configuration file for reporting"); - printf( "\n-b - Specifies the build number"); - printf( "\n-u - Specifies the user running the unit test"); - printf( "\n-i - Interactive mode (pause before exit)"); - printf( "\n-h - Shows this screen"); -#endif + f_conPrintf( "\nCommand-line usage:"); + f_conPrintf( "\n\n[-l] [-d]"); + f_conPrintf( "[-c] [-b] [-u]"); + f_conPrintf( "\n-l - Specifies a log file to print to"); + f_conPrintf( "\n-d - Display output"); + f_conPrintf( "\n-t - Specifies configuration file for reporting"); + f_conPrintf( "\n-b - Specifies the build number"); + f_conPrintf( "\n-u - Specifies the user running the unit test"); + f_conPrintf( "\n-i - Interactive mode (pause before exit)"); + f_conPrintf( "\n-h - Shows this screen"); } -#if defined( FLM_NLM) +#if defined( FLM_RING_ZERO_NLM) #define main nlm_main extern "C" @@ -225,7 +211,15 @@ int main( unsigned int i = 1; ArgList args; TEST_INFO testInfo; - FLMBOOL bPauseBeforeExit = FALSE; + + if( RC_BAD( rc = FlmStartup())) + { + goto Exit; + } + +#ifdef FLM_NLM + f_conInit( 0, 0, "FLAIM Unit Test"); +#endif if( argc > 1) { @@ -267,31 +261,21 @@ int main( { f_strcpy( testInfo.pszUser, &args[i][2]); } - else if( (args[i][1] == 'i') || (args[i][1] == 'I')) - { - bPauseBeforeExit = TRUE; - } else { -#ifndef FLM_NLM - printf( "\nInvalid parameter"); + f_conPrintf( "\nInvalid parameter"); printHelp(); -#endif goto Exit; } i++; } -#ifndef FLM_NLM - printf("Running %s\n", argv[0]); -#endif + f_conPrintf( "Running %s\n", argv[0]); if( RC_BAD( rc = getTest( &pTest))) { -#ifndef FLM_NLM - printf( "ERROR: Unable to create test instance\n"); -#endif + f_conPrintf( "ERROR: Unable to create test instance\n"); goto Exit; } @@ -299,9 +283,7 @@ int main( testInfo.pszConfig, testInfo.pszEnvironment, testInfo.pszBuild, testInfo.pszUser) != 0) { -#ifndef FLM_NLM - printf( "\nTest initialization failed"); -#endif + f_conPrintf( "\nTest initialization failed"); goto Exit; } @@ -316,14 +298,11 @@ Exit: { pTest->Release(); } - - if( bPauseBeforeExit) - { -#ifndef FLM_NLM - printf( "Press any key to exit.\n"); - getchar(); + +#ifdef FLM_NLM + f_conExit(); #endif - } + FlmShutdown(); return( (int)rc); } @@ -850,11 +829,6 @@ RCODE TestBase::init( { RCODE rc = FERR_MEM; - if( RC_BAD( rc = FlmStartup())) - { - goto Exit; - } - // VISIT: here -- disable asserts on FLAIM errors via a config call!!! m_bLog = bLog; @@ -1565,33 +1539,3 @@ void FilenameIterator::produceFilename( f_sprintf( pszTemp, "%03x", (unsigned)m_uiExtension); f_strcat( pszBuffer, pszTemp); } - -/*************************************************************************** -Desc: -****************************************************************************/ -#ifdef FLM_NLM -void flmUnittestFatalRuntimeError( void) -{ -} -#endif - -/*************************************************************************** -Desc: -****************************************************************************/ -#ifdef FLM_NLM -int flmUnittestLoad( void) -{ - return (int)FlmStartup(); -} -#endif - -/*************************************************************************** -Desc: -****************************************************************************/ -#ifdef FLM_NLM -int flmUnittestUnload( void) -{ - FlmShutdown(); - return 0; -} -#endif