mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-06 20:30:36 +08:00
public: add test case for COM_FixSlashes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user