diff --git a/public/tests/test_strings.c b/public/tests/test_strings.c index 9701fc30..39572880 100644 --- a/public/tests/test_strings.c +++ b/public/tests/test_strings.c @@ -57,6 +57,30 @@ static int Test_Colorstr( void ) return 0; } +static int Test_FixSlashes( void ) +{ + string s = "path\\with\\back\\slashes"; + string s2 = "path/with/fwd/slashes"; + string s3 = "path\\with/mixed\\slashes"; + + COM_FixSlashes( s ); + + if( Q_strcmp( s, "path/with/back/slashes" )) + return 1; + + COM_FixSlashes( s2 ); + + if( Q_strcmp( s2, "path/with/fwd/slashes" )) + return 2; + + COM_FixSlashes( s3 ); + + if( Q_strcmp( s3, "path/with/mixed/slashes" )) + return 3; + + return 0; +} + int main( void ) { int ret = Test_Strcpycatcmp(); @@ -74,5 +98,10 @@ int main( void ) if( ret > 0 ) return ret + 32; + ret = Test_FixSlashes(); + + if( ret > 0 ) + return ret + 48; + return 0; }