public: add test case for COM_FixSlashes
This commit is contained in:
parent
59b9b31604
commit
58bfa247a4
1 changed files with 29 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue