From nobody Mon Feb 9 03:52:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1636986185; cv=none; d=zohomail.com; s=zohoarc; b=H7ww1GAjrtmDxyJMsQWVmP5WuuczeB0mhl7JwwrYdMH1O1dyqLep3zs+MfppIVyeRFW8JJapRh0vU7Jzbj3QhJyKsKyrC5R7m2KX3RJrafAxY9Bb/QowXORCCqZNe8Z0u1ERt5map0FSniS8SUEr+Z9+oGMHaMfGn8m7BXjdV8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636986185; h=Content-Type:Content-Transfer-Encoding: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=LCpM+CyFw0CJ+PiirEABwZfg0T29JEwjbMrm6HIfwUI=; b=Ko/k3UMJYKn368W9IqEK9wzug9EhNAiwa957ANNkrdMnXlYXGV+Bbtb9Bywq+yCUahHM8GNqnXF8KSXSVxgAM+qJjcNESkVwWKouXINwyVxRfq0EHeChRG+7NTDQ/JF8/oBDfXzBYOnT/laaZo6FuGCEkDxmznVfRJNbyuEqcvM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1636986185200424.4359218901625; Mon, 15 Nov 2021 06:23:05 -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-139-KuTgdgjEMIKH3o_RkwWqcw-1; Mon, 15 Nov 2021 09:23:02 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EECB5703E; Mon, 15 Nov 2021 14:22:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D61F7794B0; Mon, 15 Nov 2021 14:22:54 +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 95D454EA3B; Mon, 15 Nov 2021 14:22:54 +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 1AFEMWE6009782 for ; Mon, 15 Nov 2021 09:22:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id AC31722719; Mon, 15 Nov 2021 14:22:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EF275BAE5 for ; Mon, 15 Nov 2021 14:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636986184; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=LCpM+CyFw0CJ+PiirEABwZfg0T29JEwjbMrm6HIfwUI=; b=HlJ/AtIjBqx99RqKJymY/d0IO2Cqu6DH3PAKUI8IPk+XkPXRV32iEmj8r/Nv6Xtju4g03n QQc0MNfg/tkNhivcDYK5nEGWJ0qt33lAJMSS/6T1r/jOSBjII6Gu8GotyRP2tBSLrt/eFE BUMsftqKtgnY5fvVQ+ec3MC+8D1iW+g= X-MC-Unique: KuTgdgjEMIKH3o_RkwWqcw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/18] virjsontest: Replace virJSONValueObjectCreate by virJSONValueObjectAdd Date: Mon, 15 Nov 2021 15:22:11 +0100 Message-Id: <4801b979c4d147a2710465ad94e2ccdb081e65b1.1636986086.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636986266503100007 Content-Type: text/plain; charset="utf-8" virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- tests/virjsontest.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index 5e26de1f22..ddb93803b7 100644 --- a/tests/virjsontest.c +++ b/tests/virjsontest.c @@ -391,10 +391,10 @@ testJSONEscapeObj(const void *data G_GNUC_UNUSED) g_autofree char *result =3D NULL; const char *parsednestedstr; - if (virJSONValueObjectCreate(&nestjson, - "s:stringkey", "stringvalue", - "i:numberkey", 1234, - "b:booleankey", false, NULL) < 0) { + if (virJSONValueObjectAdd(&nestjson, + "s:stringkey", "stringvalue", + "i:numberkey", 1234, + "b:booleankey", false, NULL) < 0) { VIR_TEST_VERBOSE("failed to create nested json object"); return -1; } @@ -404,7 +404,7 @@ testJSONEscapeObj(const void *data G_GNUC_UNUSED) return -1; } - if (virJSONValueObjectCreate(&json, "s:test", neststr, NULL) < 0) { + if (virJSONValueObjectAdd(&json, "s:test", neststr, NULL) < 0) { VIR_TEST_VERBOSE("Failed to create json object"); return -1; } @@ -446,8 +446,8 @@ testJSONObjectFormatSteal(const void *opaque G_GNUC_UNU= SED) VIR_TEST_VERBOSE("Failed to create json object"); } - if (virJSONValueObjectCreate(&t1, "a:t", &a1, "s:f", NULL, NULL) !=3D = -1) { - VIR_TEST_VERBOSE("virJSONValueObjectCreate(t1) should have failed"= ); + if (virJSONValueObjectAdd(&t1, "a:t", &a1, "s:f", NULL, NULL) !=3D -1)= { + VIR_TEST_VERBOSE("virJSONValueObjectAdd(t1) should have failed"); return -1; } @@ -456,8 +456,8 @@ testJSONObjectFormatSteal(const void *opaque G_GNUC_UNU= SED) return -1; } - if (virJSONValueObjectCreate(&t2, "s:f", NULL, "a:t", &a1, NULL) !=3D = -1) { - VIR_TEST_VERBOSE("virJSONValueObjectCreate(t2) should have failed"= ); + if (virJSONValueObjectAdd(&t2, "s:f", NULL, "a:t", &a1, NULL) !=3D -1)= { + VIR_TEST_VERBOSE("virJSONValueObjectAdd(t2) should have failed"); return -1; } --=20 2.31.1