summaryrefslogtreecommitdiff
path: root/src/tests/xb_test_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/xb_test_file.cpp')
-rwxr-xr-xsrc/tests/xb_test_file.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/tests/xb_test_file.cpp b/src/tests/xb_test_file.cpp
index ca32693..4614805 100755
--- a/src/tests/xb_test_file.cpp
+++ b/src/tests/xb_test_file.cpp
@@ -39,9 +39,9 @@ int main( int argCnt, char **av )
else if( av[1][0] == 'V' )
po = 2;
}
-
-#ifdef XB_LOGGING_SUPPORT
xbXBase x;
+
+ #ifdef XB_LOGGING_SUPPORT
x.EnableMsgLogging();
if( po ){
std::cout << "Logfile is [" << x.GetLogFqFileName().Str() << "]" << std::endl;
@@ -49,7 +49,7 @@ int main( int argCnt, char **av )
xbString sMsg;
sMsg.Sprintf( "Program [%s] initializing...", av[0] );
x.WriteLogMessage( sMsg );
-#endif
+ #endif
InitTime();
xbFile f( &x );
@@ -57,13 +57,13 @@ int main( int argCnt, char **av )
xbString sWrkStr2;
sWrkStr = PROJECT_DATA_DIR;
f.SetDataDirectory( PROJECT_DATA_DIR );
-
+
#ifdef WIN32
sWrkStr.SwapChars( '/', '\\' );
#else
sWrkStr.SwapChars( '\\', '/' );
#endif
-
+
rc += TestMethod( po, "Set/GetDataDirectory()", f.GetDataDirectory(), sWrkStr, sWrkStr.Len());
f.SetFileName( "TestFile.txt" );
@@ -85,14 +85,13 @@ int main( int argCnt, char **av )
sWrkStr += "TestFile.txt";
rc += TestMethod( po, "GetFqFileName()", f.GetFqFileName(), sWrkStr, 26 );
-#ifdef WIN32
+ #ifdef WIN32
sWrkStr = "\\some\\directory\\myfile.dat";
sWrkStr2 = "\\some\\directory\\";
-#else
+ #else
sWrkStr = "/some/directory/myfile.dat";
sWrkStr2 = "/some/directory/";
-#endif
-
+ #endif
f.SetFqFileName( sWrkStr );
rc += TestMethod( po, "GetDirectory()", f.GetDirectory(), sWrkStr2, 16 );
@@ -107,7 +106,6 @@ int main( int argCnt, char **av )
rc += TestMethod( po, "xbFopen()", f.xbFopen( "w+b", XB_MULTI_USER ), XB_NO_ERROR );
-
xbString sTest;
sTest = "Test Data";
rc += TestMethod( po, "xbWrite()", f.xbFwrite( sTest.Str(), 9, 1 ), XB_NO_ERROR );
@@ -161,12 +159,10 @@ int main( int argCnt, char **av )
rc += TestMethod( po, "GetFileExtPart()", f2.GetFileExtPart( sFqnS , sFn ), XB_NO_ERROR );
rc += TestMethod( po, "GetFileExtPart()", f2.GetFileDirPart( sFqnS , sFn ), XB_NO_ERROR );
-
rc += TestMethod( po, "SetBlockSize()", f.SetBlockSize( 100 ), XB_INVALID_BLOCK_SIZE );
rc += TestMethod( po, "SetBlockSize()", f.SetBlockSize( 512 ), XB_NO_ERROR );
rc += TestMethod( po, "GetBlockSize()", (xbInt32) f.GetBlockSize(), 512 );
-
char BlockBuf[513];
memset( BlockBuf, 0x00, 513 );
rc += TestMethod( po, "xbFopen()", f.xbFopen( "w+b", XB_SINGLE_USER ), XB_NO_ERROR );
@@ -202,10 +198,10 @@ int main( int argCnt, char **av )
if( po > 0 || rc < 0 )
fprintf( stdout, "Total Errors = %d\n", rc * -1 );
-#ifdef XB_LOGGING_SUPPORT
+ #ifdef XB_LOGGING_SUPPORT
sMsg.Sprintf( "Program [%s] terminating with [%d] errors...", av[0], rc * -1 );
x.WriteLogMessage( sMsg );
-#endif
+ #endif
return rc;
}