source: trunk/libtransmission/clients-test.c @ 5723

Last change on this file since 5723 was 5723, checked in by charles, 14 years ago

#905: update peer_id client lists. add a dozen or so new clients from Azureus (thanks amc1!)

File size: 1.0 KB
Line 
1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include "transmission.h"
5#include "clients.h"
6
7#define VERBOSE 0
8
9#define check(A) { \
10    ++test; \
11    if (A) { \
12        if( VERBOSE ) \
13            fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
14    } else { \
15        if( VERBOSE ) \
16            fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
17        return test; \
18    } \
19}
20
21int
22main( void )
23{
24    int test = 0;
25    char buf[128];
26
27    tr_clientForId( buf, sizeof( buf ), "-FC1013-" ); check( !strcmp( buf, "FileCroc 1.0.1.3" ) );
28    tr_clientForId( buf, sizeof( buf ), "-MR1100-" ); check( !strcmp( buf, "Miro 1.1.0.0" ) );
29    tr_clientForId( buf, sizeof( buf ), "-TR0006-" ); check( !strcmp( buf, "Transmission 0.6" ) );
30    tr_clientForId( buf, sizeof( buf ), "-TR0072-" ); check( !strcmp( buf, "Transmission 0.72" ) );
31    tr_clientForId( buf, sizeof( buf ), "-TR111Z-" ); check( !strcmp( buf, "Transmission 1.11 (Dev)" ) );
32
33    /* cleanup */
34    return 0;
35}
Note: See TracBrowser for help on using the repository browser.