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 | |
---|
21 | #define TEST_CLIENT(A,B) \ |
---|
22 | tr_clientForId( buf, sizeof( buf ), A ); \ |
---|
23 | check( !strcmp( buf, B ) ); |
---|
24 | |
---|
25 | int |
---|
26 | main( void ) |
---|
27 | { |
---|
28 | int test = 0; |
---|
29 | char buf[128]; |
---|
30 | |
---|
31 | TEST_CLIENT( "-FC1013-", "FileCroc 1.0.1.3" ); |
---|
32 | TEST_CLIENT( "-MR1100-", "Miro 1.1.0.0" ); |
---|
33 | TEST_CLIENT( "-TR0006-", "Transmission 0.6" ); |
---|
34 | TEST_CLIENT( "-TR0072-", "Transmission 0.72" ); |
---|
35 | TEST_CLIENT( "-TR111Z-", "Transmission 1.11+" ); |
---|
36 | |
---|
37 | /* cleanup */ |
---|
38 | return 0; |
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.