Commit 8c0d155f authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

message_tester.c: add "Lime text message to non lime" test

parent 6a70c5c2
......@@ -802,6 +802,37 @@ static void lime_text_message(void) {
linphone_core_manager_destroy(pauline);
}
static void lime_text_message_to_non_lime(void) {
FILE *ZIDCachePaulineFD;
LinphoneChatRoom* chat_room;
char* filepath;
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
/* make sure lime is enabled */
linphone_core_enable_lime(marie->lc, 0);
linphone_core_enable_lime(pauline->lc, 1);
/* set the zid caches files : create two ZID cache from this valid one inserting the auto-generated sip URI for the peer account as keys in ZID cache are indexed by peer sip uri */
ZIDCachePaulineFD = fopen_from_write_dir("tmpZIDCachePauline.xml", "w");
fprintf(ZIDCachePaulineFD, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cache><selfZID>005dbe0399643d953a2202dd</selfZID><peer><ZID>ef7692d0792a67491ae2d44e</ZID><rs1>9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045</rs1><aux>f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e</aux><rs2>2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899</rs2><uri>%s</uri><rcvKey>08df5907d30959b8cb70f6fff2d8febd88fb41b0c8afc39e4b972f86dd5cfe2d</rcvKey><sndKey>60f020a3fe11dc2cc0e1e8ed9341b4cd14944db806ca4fc95456bbe45d95c43a</sndKey><rcvSId>5f9aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193</rcvSId><sndSId>bcffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b77193</sndSId><rcvIndex>00000078</rcvIndex><sndIndex>000001cf</sndIndex><pvs>01</pvs></peer><peer><ZID>1234567889643d953a2202ee</ZID><rs1>9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045</rs1><aux>f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e</aux><rs2>2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899</rs2><uri>%s</uri><sndKey>81e6e6362c34dc974263d1f77cbb9a8d6d6a718330994379099a8fa19fb12faa</sndKey><rcvKey>25d9ac653a83c4559cb0ae7394e7cd3b2d3c57bb28e62068d2df23e8f9b77193</rcvKey><sndSId>f69aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193</sndSId><rcvSId>22ffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b77193</rcvSId><sndIndex>0000002e</sndIndex><rcvIndex>00000000</rcvIndex><pvs>01</pvs></peer></cache>", linphone_address_as_string_uri_only(marie->identity), linphone_address_as_string_uri_only(marie->identity));
fclose(ZIDCachePaulineFD);
filepath = bc_tester_file("tmpZIDCachePauline.xml");
linphone_core_set_zrtp_secrets_file(pauline->lc, filepath);
ms_free(filepath);
chat_room = linphone_core_get_chat_room(pauline->lc, marie->identity);
linphone_chat_room_send_message(chat_room,"Bla bla bla bla");
//since we cannot decrypt message, we should not receive any message
BC_ASSERT_FALSE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageReceivedLegacy,0, int, "%d");
BC_ASSERT_PTR_NOT_NULL(linphone_core_get_chat_room(marie->lc,pauline->identity));
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
void lime_transfer_message_base(bool_t encrypt_file) {
FILE *ZIDCacheMarieFD, *ZIDCachePaulineFD;
LinphoneCoreManager *marie, *pauline;
......@@ -1688,6 +1719,7 @@ test_t message_tests[] = {
{"IsComposing notification", is_composing_notification},
#ifdef HAVE_LIME
{"Lime text message", lime_text_message},
{"Lime text message to non lime", lime_text_message_to_non_lime},
{"Lime transfer message", lime_transfer_message},
{"Lime transfer message without encryption", lime_transfer_message_without_encryption},
{"Lime unitary", lime_unit},
......
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