From 1fc620c0c1481e6207b047d2e5d9f599fbd3dd3a Mon Sep 17 00:00:00 2001 From: "zugz (tox)" Date: Thu, 16 Aug 2018 00:01:21 +0200 Subject: [PATCH] disable name propagation test --- auto_tests/conference_test.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/auto_tests/conference_test.c b/auto_tests/conference_test.c index e231fe1bb72..099aa862688 100644 --- a/auto_tests/conference_test.c +++ b/auto_tests/conference_test.c @@ -21,7 +21,7 @@ #define NAMELEN 9 #define NAME_FORMAT "%9s" -#define NAME_FORMAT_STR "Old #%4u" +#define NAME_FORMAT_STR "Tox #%4u" #define NEW_NAME_FORMAT_STR "New #%4u" #define NEW_NAME_PREFIX "New" #define NEW_NAME_PREFIX_LEN 3 @@ -132,6 +132,10 @@ static bool all_connected_to_group(uint32_t tox_count, Tox **toxes) static void run_conference_tests(Tox **toxes, State *state) { + /* disabling name propagation check for now, as it occasionally fails due + * to disconnections too short to trigger freezing */ + const bool check_name_propagation = false; + printf("letting random toxes timeout\n"); bool disconnected[NUM_GROUP_TOX]; @@ -160,12 +164,14 @@ static void run_conference_tests(Tox **toxes, State *state) c_sleep(ITERATION_INTERVAL); } - printf("changing names\n"); + if (check_name_propagation) { + printf("changing names\n"); - for (uint16_t i = 0; i < NUM_GROUP_TOX; ++i) { - char name[NAMELEN + 1]; - snprintf(name, NAMELEN + 1, NEW_NAME_FORMAT_STR, state[i].index); - tox_self_set_name(toxes[i], (const uint8_t *)name, NAMELEN, nullptr); + for (uint16_t i = 0; i < NUM_GROUP_TOX; ++i) { + char name[NAMELEN + 1]; + snprintf(name, NAMELEN + 1, NEW_NAME_FORMAT_STR, state[i].index); + tox_self_set_name(toxes[i], (const uint8_t *)name, NAMELEN, nullptr); + } } printf("reconnecting toxes\n"); @@ -206,10 +212,13 @@ static void run_conference_tests(Tox **toxes, State *state) ck_assert_msg(len == NAMELEN, "name of #%u according to #%u has incorrect length %u", state[j].index, state[i].index, (unsigned int)len); uint8_t name[NAMELEN]; - tox_conference_peer_get_name(toxes[i], 0, j, name, nullptr); - /* Note the toxes will have been reordered */ - ck_assert_msg(memcmp(name, "New", 3) == 0, - "name of #%u according to #%u not updated", state[j].index, state[i].index); + + if (check_name_propagation) { + tox_conference_peer_get_name(toxes[i], 0, j, name, nullptr); + /* Note the toxes will have been reordered */ + ck_assert_msg(memcmp(name, "New", 3) == 0, + "name of #%u according to #%u not updated", state[j].index, state[i].index); + } } }