Commit 607f86a3 authored by François Grisez's avatar François Grisez
Browse files

Improve test about sending special characters through RTT chat

parent 793c32d0
......@@ -163,7 +163,7 @@ char *Utils::utf8ToChar (uint32_t ic) {
result[1] = static_cast<char>(0x80 + ((ic & 0x3F)));
result[0] = static_cast<char>(0xC0 + ((ic >> 6) & 0x1F));
size = 2;
} else if (ic < 0x100000) {
} else if (ic < 0x10000) {
result[2] = static_cast<char>(0x80 + (ic & 0x3F));
result[1] = static_cast<char>(0x80 + ((ic >> 6) & 0x3F));
result[0] = static_cast<char>(0xE0 + ((ic >> 12) & 0xF));
......
......@@ -1986,18 +1986,9 @@ static void real_time_text_message_accented_chars(void) {
BC_ASSERT_PTR_NOT_NULL(marie_chat_room);
if (pauline_chat_room && marie_chat_room) {
LinphoneChatMessage* rtt_message = linphone_chat_room_create_message(pauline_chat_room,NULL);
uint32_t message[] = {0xe3/*ã*/, 0xe6/*æ*/, 0xe7/*ç*/, 0xe9/*é*/, 0xee/*î*/, 0xf8/*ø*/, 0xf9/*ù*/, 0xff/*ÿ*/, 0x2a7d/*⩽*/, 0x1f600/*😀*/};
const int message_len = sizeof(message) / sizeof(uint32_t);
int i;
uint32_t message[8];
int message_len = 8;
message[0] = 0xE3; // ã
message[1] = 0xE6; // æ
message[2] = 0xE7; // ç
message[3] = 0xE9; // é
message[4] = 0xEE; // î
message[5] = 0xF8; // ø
message[6] = 0xF9; // ù
message[7] = 0xFF; // ÿ
for (i = 0; i < message_len; i++) {
linphone_chat_message_put_char(rtt_message, message[i]);
BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000));
......@@ -2011,7 +2002,7 @@ static void real_time_text_message_accented_chars(void) {
const char *text = linphone_chat_message_get_text(marie->stat.last_received_chat_message);
BC_ASSERT_PTR_NOT_NULL(text);
if (text)
BC_ASSERT_STRING_EQUAL(text, "ãæçéîøùÿ");
BC_ASSERT_STRING_EQUAL(text, "ãæçéîøùÿ⩽😀");
}
linphone_chat_message_unref(rtt_message);
}
......
......@@ -342,7 +342,7 @@ static void avoid_pulseaudio_hack(LinphoneCoreManager *mgr){
void linphone_core_manager_configure (LinphoneCoreManager *mgr) {
LinphoneImNotifPolicy *im_notif_policy;
char *hellopath = bc_tester_res("sounds/hello8000.wav");
const char * filepath = mgr->rc_path?bctbx_strdup_printf("%s/%s", bc_tester_get_resource_dir_prefix() ,mgr->rc_path):NULL;
char *filepath = mgr->rc_path ? bctbx_strdup_printf("%s/%s", bc_tester_get_resource_dir_prefix(), mgr->rc_path) : NULL;
if (filepath && bctbx_file_exist(filepath) != 0) {
ms_fatal("Could not find file %s in path %s, did you configured resources directory correctly?", mgr->rc_path, bc_tester_get_resource_dir_prefix());
}
......@@ -408,6 +408,8 @@ void linphone_core_manager_configure (LinphoneCoreManager *mgr) {
/*for now, we need the periodical updates facility to compute bandwidth measurements correctly during tests*/
linphone_core_enable_send_call_stats_periodical_updates(mgr->lc, TRUE);
// clean
if (filepath) bctbx_free(filepath);
}
static void generate_random_database_path (LinphoneCoreManager *mgr) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment