From nobody Thu Nov 13 23:22:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583253351; cv=none; d=zohomail.com; s=zohoarc; b=I6KzGobS3KhLTrD5F2mE0VII9+7jLIqD2jSlG0s5AYa9ChiqB+eBMPwlDeS4jNvf/SMUSgWsidYTmoI973bXFt3UYt6ZP6ooXdvz+KXOkXA9Qh09iFY2x0Mhp6XoUiUwyDiK4OUk+Fyx5d+n4WHfQdF4Lc1BlyxGuZJs/OZIBfg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583253351; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G/K2SKoqOnDjysN1i+Hx5allTxM687zxIdK14NsSRSU=; b=cU20+/kd5pPQ4Wh3Mc/8WMxj036YrVbC1ZJykPpna86JX6KOYNZtQ/fZSCeYPx4aXmiiiooIwOyChLRdqc/qee7iDLXDqGx+Thz/A4I8ZvetTDO/pdGAL6QdQembH7Vq4ik9alebk6NYC5Q7peMTwJN5DGCJQxIH26EyULr5iFo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1583253351936994.7009455035871; Tue, 3 Mar 2020 08:35:51 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-VnQXKyPtN7yBiqpb3o47WQ-1; Tue, 03 Mar 2020 11:35:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73FCE9B591; Tue, 3 Mar 2020 16:35:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4513B1001B2C; Tue, 3 Mar 2020 16:35:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E5D8318089D7; Tue, 3 Mar 2020 16:35:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 023GZCca001189 for ; Tue, 3 Mar 2020 11:35:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1A32691D6E; Tue, 3 Mar 2020 16:35:12 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-129.ams2.redhat.com [10.36.116.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1EC891D71; Tue, 3 Mar 2020 16:35:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CF64911336BD; Tue, 3 Mar 2020 17:35:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583253350; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=G/K2SKoqOnDjysN1i+Hx5allTxM687zxIdK14NsSRSU=; b=IuneHq6MD9lAJ1pkDxEVbzT7zFklYtJJH5aYdrrhIoG2kne3trvmpEGSg4qobmuIsBhjuO 5+6VtB0GR1uvVp7zb0btzsEMLX66ZjucAPIGaO9k+pXqgJMazF60AsquT9ubbQWayDvioZ G0Q2d10RHtrHje6tNlxvdVm2k5H1QCc= X-MC-Unique: VnQXKyPtN7yBiqpb3o47WQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 10/30] tests/test-qmp-event: Check event is actually emitted Date: Tue, 3 Mar 2020 17:34:45 +0100 Message-Id: <20200303163505.32041-11-armbru@redhat.com> In-Reply-To: <20200303163505.32041-1-armbru@redhat.com> References: <20200303163505.32041-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster --- tests/test-qmp-event.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c index d64066139c..7dd0053190 100644 --- a/tests/test-qmp-event.c +++ b/tests/test-qmp-event.c @@ -26,6 +26,7 @@ =20 typedef struct TestEventData { QDict *expect; + bool emitted; } TestEventData; =20 TestEventData *test_event_data; @@ -52,7 +53,7 @@ void test_qapi_event_emit(test_QAPIEvent event, QDict *d) qdict_del(d, "timestamp"); =20 g_assert(qobject_is_equal(QOBJECT(d), QOBJECT(test_event_data->expect)= )); - + test_event_data->emitted =3D true; } =20 static void event_prepare(TestEventData *data, @@ -87,6 +88,7 @@ static void test_event_a(TestEventData *data, { data->expect =3D qdict_from_jsonf_nofail("{ 'event': 'EVENT_A' }"); qapi_event_send_event_a(); + g_assert(data->emitted); qobject_unref(data->expect); } =20 @@ -95,6 +97,7 @@ static void test_event_b(TestEventData *data, { data->expect =3D qdict_from_jsonf_nofail("{ 'event': 'EVENT_B' }"); qapi_event_send_event_b(); + g_assert(data->emitted); qobject_unref(data->expect); } =20 @@ -107,6 +110,7 @@ static void test_event_c(TestEventData *data, "{ 'event': 'EVENT_C', 'data': {" " 'a': 1, 'b': { 'integer': 2, 'string': 'test1' }, 'c': 'test2' }= }"); qapi_event_send_event_c(true, 1, true, &b, "test2"); + g_assert(data->emitted); qobject_unref(data->expect); } =20 @@ -132,6 +136,7 @@ static void test_event_d(TestEventData *data, " 'string': 'test2', 'enum2': 'value2' }," " 'b': 'test3', 'enum3': 'value3' } }"); qapi_event_send_event_d(&a, "test3", false, NULL, true, ENUM_ONE_VALUE= 3); + g_assert(data->emitted); qobject_unref(data->expect); } =20 --=20 2.21.1