From nobody Thu Nov 14 18:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708906291; cv=none; d=zohomail.com; s=zohoarc; b=WQvtp6vW79JLuvambWvkyaKaLNNNE+3aOwK8u1BGd81g08sJK+GdGkO0NzkDUrIRR2lGDkAHQFiqRbUDX0mLZYbobsnRbQI0xUtwZt/n5Sa8CZFBmgFyX3w1IKN+ME3Axts4u4iaZiIaJYogVYPIZ43QN3RIoksDCGR2QJBrIgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708906291; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kP3rP5kDO6a2F7RySUKQZtGqTq+p08N2Zl2emdCf9Jg=; b=X0XdEpB9hNFomEi4ZhSQicIoFmvvdj/o2pfoHb+weSjZx2kb1wGcLoc06YF+QKbnNnhr8IEHvyPSZcX6aDAktgayvtCeaypyxUn9Q5N3Vz/vaQU8BPUJ9A2x4oYRiu0G46g0o68q0u92wXmKBzHU7fQN8MKhhzCu+/R8rtsLcKk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708906291362984.4665224052608; Sun, 25 Feb 2024 16:11:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reOTz-0007u4-Uk; Sun, 25 Feb 2024 19:04:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reOTM-0006zt-5H; Sun, 25 Feb 2024 19:04:00 -0500 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reOTH-0000ah-Rz; Sun, 25 Feb 2024 19:03:55 -0500 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-607e54b6cf5so16966947b3.0; Sun, 25 Feb 2024 16:03:47 -0800 (PST) Received: from localhost.localdomain ([201.203.117.224]) by smtp.gmail.com with ESMTPSA id t18-20020a818312000000b00607bfa1913csm938171ywf.114.2024.02.25.16.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 16:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708905827; x=1709510627; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kP3rP5kDO6a2F7RySUKQZtGqTq+p08N2Zl2emdCf9Jg=; b=D7X7pWP12ggAiXAUWiq5wsK1x1x7Pppmzm42ngd1+osoibDlXrOyMLVfLcfiXI3lj+ awMpCiCFPHdoS2pCr0wD2oDye9SSxpsSTBkrZSqVrhpIxqcbGKx88f0EGnYKdmlC4oGa lC1lEo4wwRUCnX8D3uv2wO2zCnJStKj1Or8BkZRBMun1WrbrGOYjY9wcZh7dN1gPc3Vq h7lZ9nDkH+H5qrHeitW/e0pedQglDZlqCJIWZn4mNnF+DncyDXoBsctEAR41ZZmX1xcA 4hwNz+P7nDU6433O0z6dwQjCctslK0LUcmyMRY6BrYki2n0s2OGP8HPcRZlGlrVar3hM SvaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708905827; x=1709510627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kP3rP5kDO6a2F7RySUKQZtGqTq+p08N2Zl2emdCf9Jg=; b=DTPuR7sgjFuFnUrBmsoraPC+S7EIbEmf/ChXM/x9cNAb+2QnBjH/c6jcBiiodulQFZ IUcJwUVQ0maiOex7rrakaYLjU0EI2zOBDZ1ryS7XsPL6LelAojUPtcjPd2/rlMoIhqN0 6T8TGo0fXwZ6dWIbH0bkpnJmjbfAlUskfHzfPY3HQR7bEosTPaMDmYc5UuxInOkBtNqy jfd7uo6UKFSnani6q3ZWRVXf7y8pv3mU2FbP1EyzTJe2iP1IAvUUotaYRRKB+nu0M9s1 K/sQN30KkPJsB6IIQdWz6ePx8jLBG5FHt3OXufqFZD78+DoAGBgcGRTy7yHlHD6T4Lgd i2dg== X-Gm-Message-State: AOJu0YwWeTdarcOqrnL2Jsy39W0+81ionE5kbKg/eoM5Fvn4tCenRMq3 lddu31Vei77bXg7aqhS5lsnERsYMlD12DOqrbfGji9XmXhSbjpsaxTePMZP8TCdCvQ== X-Google-Smtp-Source: AGHT+IFuLWkS5BBYLNN6tPQbCGXS0oDH2gWeQJG1XdOjd31QH0Gp99YeRD9faWPZV7CXb5xRdS2aLw== X-Received: by 2002:a0d:db57:0:b0:607:7bce:fe28 with SMTP id d84-20020a0ddb57000000b006077bcefe28mr3725646ywe.13.1708905826971; Sun, 25 Feb 2024 16:03:46 -0800 (PST) From: Sergey Kambalin X-Google-Original-From: Sergey Kambalin To: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, Sergey Kambalin Subject: [PATCH v6 37/41] Add mailbox property tests. Part 2 Date: Sun, 25 Feb 2024 18:02:55 -0600 Message-Id: <20240226000259.2752893-38-sergey.kambalin@auriga.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226000259.2752893-1-sergey.kambalin@auriga.com> References: <20240226000259.2752893-1-sergey.kambalin@auriga.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::112d; envelope-from=serg.oker@gmail.com; helo=mail-yw1-x112d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708906291765100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Sergey Kambalin Reviewed-by: Peter Maydell --- tests/qtest/bcm2838-mbox-property-test.c | 196 ++++++++++++++++++++++- 1 file changed, 195 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838= -mbox-property-test.c index acb421915b..b251d3f552 100644 --- a/tests/qtest/bcm2838-mbox-property-test.c +++ b/tests/qtest/bcm2838-mbox-property-test.c @@ -50,7 +50,8 @@ FIELD(GET_CLOCK_STATE_CMD, NPRES, 1, 1) (TEST_TAG_TYPE(testname) * tag); = \ static void CHECK_FN_NAME(testname, __VA_ARGS__) = \ (TEST_TAG_TYPE(testname) *tag); = \ - static void TEST_FN_NAME(testname, __VA_ARGS__)(void) { = \ + static void TEST_FN_NAME(testname, __VA_ARGS__)(void) = \ + { = \ struct { = \ MboxBufHeader header; = \ TEST_TAG_TYPE(testname) tag; = \ @@ -189,6 +190,179 @@ DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, EMMC) { } =20 /*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_CLOCK_RATE, UART) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UART); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_UART); +} +DECLARE_TEST_CASE_SETUP(GET_CLOCK_RATE, UART) { + tag->request.value.clock_id =3D CLOCK_ID_UART; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_CLOCK_RATE, UART) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UART); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_UART); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_CLOCK_RATE, UART) { + tag->request.value.clock_id =3D CLOCK_ID_UART; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MIN_CLOCK_RATE, UART) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UART); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_UART); +} +DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, UART) { + tag->request.value.clock_id =3D CLOCK_ID_UART; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_CLOCK_RATE, CORE) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_CORE); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_CORE); +} +DECLARE_TEST_CASE_SETUP(GET_CLOCK_RATE, CORE) { + tag->request.value.clock_id =3D CLOCK_ID_CORE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_CLOCK_RATE, CORE) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_CORE); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_CORE); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_CLOCK_RATE, CORE) { + tag->request.value.clock_id =3D CLOCK_ID_CORE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MIN_CLOCK_RATE, CORE) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_CORE); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_CORE); +} +DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, CORE) { + tag->request.value.clock_id =3D CLOCK_ID_CORE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_CLOCK_RATE, ANY) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UNDEFIN= ED); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_ANY); +} +DECLARE_TEST_CASE_SETUP(GET_CLOCK_RATE, ANY) { + tag->request.value.clock_id =3D CLOCK_ID_UNDEFINED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_CLOCK_RATE, ANY) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UNDEFIN= ED); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_ANY); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_CLOCK_RATE, ANY) { + tag->request.value.clock_id =3D CLOCK_ID_UNDEFINED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MIN_CLOCK_RATE, ANY) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UNDEFIN= ED); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_ANY); +} +DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, ANY) { + tag->request.value.clock_id =3D CLOCK_ID_UNDEFINED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_TEMPERATURE) { + g_assert_cmphex(tag->response.value.temperature_id, =3D=3D, TEMPERATUR= E_ID_SOC); + g_assert_cmpint(tag->response.value.temperature, =3D=3D, TEMPERATURE_S= OC); +} +DECLARE_TEST_CASE_SETUP(GET_TEMPERATURE) { + tag->request.value.temperature_id =3D TEMPERATURE_ID_SOC; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_TEMPERATURE) { + g_assert_cmphex(tag->response.value.temperature_id, =3D=3D, TEMPERATUR= E_ID_SOC); + g_assert_cmpint(tag->response.value.temperature, =3D=3D, TEMPERATURE_S= OC_MAX); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_TEMPERATURE) { + tag->request.value.temperature_id =3D TEMPERATURE_ID_SOC; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_ALLOCATE) { + g_assert_cmphex(tag->response.value.base, =3D=3D, VC_FB_BASE); + g_assert_cmphex(tag->response.value.size, =3D=3D, VC_FB_SIZE); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_ALLOCATE) { + tag->request.value.alignment =3D ALIGN_4K; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_RELEASE) { + /* No special checks are needed for this test */ +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_BLANK) { + g_assert_cmphex(tag->response.value.on, =3D=3D, 0); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_BLANK) { + tag->request.value.on =3D 0; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, DUMMY_VALUE); + g_assert_cmpint(tag->response.value.height, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT) { + tag->request.value.width =3D DUMMY_VALUE; + tag->request.value.height =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT, INITIAL) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 640); + g_assert_cmpint(tag->response.value.height, =3D=3D, 480); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 800); + g_assert_cmpint(tag->response.value.height, =3D=3D, 600); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT) { + tag->request.value.width =3D 800; + tag->request.value.height =3D 600; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, DUMMY_VALUE); + g_assert_cmpint(tag->response.value.height, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT) { + tag->request.value.width =3D DUMMY_VALUE; + tag->request.value.height =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT, INITIAL) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 640); + g_assert_cmpint(tag->response.value.height, =3D=3D, 480); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 800); + g_assert_cmpint(tag->response.value.height, =3D=3D, 600); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT) { + tag->request.value.width =3D 800; + tag->request.value.height =3D 600; +} + +//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -202,6 +376,26 @@ int main(int argc, char **argv) QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, EMMC); QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, EMMC); QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, EMMC); + QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, UART); + QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, UART); + QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, UART); + QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, CORE); + QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, CORE); + QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, CORE); + QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, ANY); + QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, ANY); + QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, ANY); + QTEST_ADD_TEST_CASE(GET_TEMPERATURE); + QTEST_ADD_TEST_CASE(GET_MAX_TEMPERATURE); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_ALLOCATE); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_RELEASE); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_BLANK); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT, INITIAL); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT, INITIAL); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT); =20 return g_test_run(); } --=20 2.34.1