| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#include "../../../src/rist-retx-domain.h" |
| 12 |
|
| 13 |
#include <stdio.h> |
| 14 |
|
| 15 |
static int check(const char *name, enum rist_profile profile, |
| 16 |
bool remote_adv, bool want) |
| 17 |
{ |
| 18 |
bool got = rist_retx_use_rtp_domain(profile, remote_adv); |
| 19 |
if (got != want) { |
| 20 |
fprintf(stderr, "FAIL: %s -> %d (want %d)\n", name, got, want); |
| 21 |
return 1; |
| 22 |
} |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
int main(void) |
| 27 |
{ |
| 28 |
int failures = 0; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
failures += check("advanced_ctx_main_peer", |
| 33 |
RIST_PROFILE_ADVANCED, false, true); |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
failures += check("advanced_ctx_advanced_peer", |
| 38 |
RIST_PROFILE_ADVANCED, true, false); |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
failures += check("main_ctx_main_peer", |
| 43 |
RIST_PROFILE_MAIN, false, false); |
| 44 |
failures += check("main_ctx_adv_flag", |
| 45 |
RIST_PROFILE_MAIN, true, false); |
| 46 |
|
| 47 |
|
| 48 |
failures += check("simple_ctx", |
| 49 |
RIST_PROFILE_SIMPLE, false, false); |
| 50 |
|
| 51 |
if (failures == 0) { |
| 52 |
printf("OK\n"); |
| 53 |
return 0; |
| 54 |
} |
| 55 |
fprintf(stderr, "Total failures: %d\n", failures); |
| 56 |
return 1; |
| 57 |
} |