|
|
|
@ -59,13 +59,17 @@ int main(void) { |
|
|
|
uint64_t peer_id = sc_derive_node_id_from_pubkey(peer.public_key); |
|
|
|
uint64_t peer_id = sc_derive_node_id_from_pubkey(peer.public_key); |
|
|
|
REQUIRE(!dm_start(inst, peer_id, peer.public_key, ed, "test", NULL)); |
|
|
|
REQUIRE(!dm_start(inst, peer_id, peer.public_key, ed, "test", NULL)); |
|
|
|
snprintf(conv, sizeof(conv), "%llu", (unsigned long long)dm_derive_conv_id(inst->node_id, peer_id)); |
|
|
|
snprintf(conv, sizeof(conv), "%llu", (unsigned long long)dm_derive_conv_id(inst->node_id, peer_id)); |
|
|
|
|
|
|
|
REQUIRE(!sc_generate_keypair(&peer) && !sc_derive_ed25519_pubkey(peer.private_key, ed)); |
|
|
|
|
|
|
|
peer_id = sc_derive_node_id_from_pubkey(peer.public_key); |
|
|
|
|
|
|
|
REQUIRE(!dm_start(inst, peer_id, peer.public_key, ed, "other", NULL)); |
|
|
|
|
|
|
|
char other[64]; snprintf(other, sizeof(other), "%llu", (unsigned long long)dm_derive_conv_id(inst->node_id, peer_id)); |
|
|
|
struct attachment_send_req* req = u_calloc(1, sizeof(*req)); REQUIRE(req); |
|
|
|
struct attachment_send_req* req = u_calloc(1, sizeof(*req)); REQUIRE(req); |
|
|
|
req->inst = inst; req->is_dm = 1; req->info.kind = ATTACHMENT_VOICE; req->preset = 1; |
|
|
|
req->inst = inst; req->is_dm = 1; req->info.kind = ATTACHMENT_VOICE; req->preset = 1; |
|
|
|
snprintf(req->target, sizeof(req->target), "%s", conv); |
|
|
|
snprintf(req->target, sizeof(req->target), "%s", conv); |
|
|
|
req->pcm = test.pcm; req->pcm_count = 48000; req->pcm_owner = &test; req->pcm_release = release_pcm; |
|
|
|
req->pcm = test.pcm; req->pcm_count = 48000; req->pcm_owner = &test; req->pcm_release = release_pcm; |
|
|
|
char active_target[64]; snprintf(active_target, sizeof(active_target), "%s", conv); |
|
|
|
char active_target[64]; snprintf(active_target, sizeof(active_target), "%s", conv); |
|
|
|
attachment_send_trampoline(req); |
|
|
|
attachment_send_trampoline(req); |
|
|
|
snprintf(active_target, sizeof(active_target), "999"); /* Выбор GUI изменился до completion. */ |
|
|
|
snprintf(active_target, sizeof(active_target), "%s", other); /* Выбор GUI изменился до completion. */ |
|
|
|
for (unsigned i = 0; i < 500 && count(inst) == 0; i++) uasync_poll(ua, 20); |
|
|
|
for (unsigned i = 0; i < 500 && count(inst) == 0; i++) uasync_poll(ua, 20); |
|
|
|
REQUIRE(count(inst) == 1 && test.released == 1 && test.release_in_worker && test.starts == 2 && test.ready == 2 && !test.failed); |
|
|
|
REQUIRE(count(inst) == 1 && test.released == 1 && test.release_in_worker && test.starts == 2 && test.ready == 2 && !test.failed); |
|
|
|
char expected[68], json[8192]; size_t length; |
|
|
|
char expected[68], json[8192]; size_t length; |
|
|
|
|