mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk libT) add tr_truncd() unit test
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user