mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk libT) add tr_truncd() unit test
This commit is contained in:
parent
e5ff7d8f3e
commit
202e593f8d
1 changed files with 7 additions and 0 deletions
|
@ -246,11 +246,18 @@ test_memmem( void )
|
|||
int
|
||||
main( void )
|
||||
{
|
||||
char buf[32];
|
||||
char *in, *out;
|
||||
int len;
|
||||
int i;
|
||||
int l;
|
||||
|
||||
/* tr_truncd */
|
||||
tr_snprintf( buf, sizeof( buf ), "%.2f%%", 99.999 );
|
||||
check( !strcmp( buf, "100.00%" ) );
|
||||
tr_snprintf( buf, sizeof( buf ), "%.2f%%", tr_truncd( 99.999, 2 ) );
|
||||
check( !strcmp( buf, "99.99%" ) );
|
||||
|
||||
/* base64 */
|
||||
out = tr_base64_encode( "YOYO!", -1, &len );
|
||||
check( out );
|
||||
|
|
Loading…
Reference in a new issue