Coverage Report

Created: 2025-10-08 19:34

/work/auto_tests/conference_two_test.c
Line
Count
Source
1
// This test checks that we can create two conferences and quit properly.
2
//
3
// This test triggers a different code path than if we only allocate a single
4
// conference. This is the simplest test possible that triggers it.
5
6
#include "../testing/misc_tools.h"
7
#include "../toxcore/tox.h"
8
#include "auto_test_support.h"
9
#include "check_compat.h"
10
11
int main(void)
12
6
{
13
    // Create toxes.
14
6
    uint32_t id = 1;
15
6
    Tox *tox1 = tox_new_log(nullptr, nullptr, &id);
16
17
    // Create two conferences and then exit.
18
6
    Tox_Err_Conference_New err;
19
6
    tox_conference_new(tox1, &err);
20
6
    ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, "failed to create conference 1: %u", err);
21
4
    tox_conference_new(tox1, &err);
22
4
    ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, "failed to create conference 2: %u", err);
23
24
2
    tox_kill(tox1);
25
26
2
    return 0;
27
4
}