summaryrefslogtreecommitdiff
path: root/src/tests/xb_test_string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/xb_test_string.cpp')
-rwxr-xr-xsrc/tests/xb_test_string.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tests/xb_test_string.cpp b/src/tests/xb_test_string.cpp
index f39c101..9d730db 100755
--- a/src/tests/xb_test_string.cpp
+++ b/src/tests/xb_test_string.cpp
@@ -43,13 +43,13 @@ int main( int argCnt, char **av = NULL )
}
xbXBase x;
+ xbString sMsg;
#ifdef XB_LOGGING_SUPPORT
x.EnableMsgLogging();
if( po ){
std::cout << "Logfile is [" << x.GetLogFqFileName().Str() << "]" << std::endl;
}
- xbString sMsg;
sMsg.Sprintf( "Program [%s] initializing...", av[0] );
x.WriteLogMessage( sMsg );
#endif
@@ -305,7 +305,6 @@ int main( int argCnt, char **av = NULL )
s1.Left( 0 );
rc += TestMethod( po, "Left(0) ", s1, "", 0 );
-
char buf[5];
buf[0] = 'W';
buf[1] = 'X';
@@ -362,7 +361,6 @@ int main( int argCnt, char **av = NULL )
free( p );
rc += TestMethod( po, "Set", s1, "1234", 4 );
-
xbDouble d = 12345678.876543;
xbString sD( d );
rc += TestMethod( po, "xbDouble Constructor", sD, "12345678.876543", 15 );
@@ -380,6 +378,13 @@ int main( int argCnt, char **av = NULL )
s3.Sprintf( "%s and %s", s1.Str(), s2.Str());
rc += TestMethod( po, "Sprintf", s3, "string 1 and string 2.0", 23 );
+ s1.Set( "abcdef.dbf" );
+ s1.Replace( "def", "DEF" );
+ rc += TestMethod( po, "Replace", s1, "abcDEF.dbf", 10 );
+ s1.Replace( ".dbf", ".DBF" );
+ rc += TestMethod( po, "Replace", s1, "abcDEF.DBF", 10 );
+
+
xbInt16 iErrorStop = 10;
xbInt16 iRc = -100;
sMsg.Sprintf( "class::method() Exception Caught. Error Stop = [%d] iRc = [%d] Expression = [%s]", iErrorStop, iRc, s3.Str() );
@@ -387,10 +392,10 @@ int main( int argCnt, char **av = NULL )
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;
}