From nobody Thu Nov 14 17:56:25 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=1708305905; cv=none; d=zohomail.com; s=zohoarc; b=YOQ+oaMlj88f0kFm+upNpTRajA+4LV6mY5VrkXz9C6YzfUrB9NfTZjOwsL/5Abe+hk/RlBHGfFv4/YHXPuGEqvP06PZb4DUn7lsMDvQsA1c9nCextXb3/ULFRTzSPcRiX+tQNJPX5VxQYJoN49a/TM0RJNed8kozabYL5W5H4qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708305905; 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=W6zlRoAk/MlOU9zhM6DLhe+k6hR1mNxVekFRYAQ+3ZyYNmiBZrEPvr4WwpGrd0jiFaeuAWhLOvw3eVjTZ3nA0Mvtj+/e+TAyUpMYhrcNE8LIE12dmOBcTR4wqTcyCLzpzex5sJr9Jxcr5//0xbOAPBz5BtjC0PBFM3Q0SyXGQf4= 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 17083059051801011.2700474614549; Sun, 18 Feb 2024 17:25:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbsJS-0005BE-TW; Sun, 18 Feb 2024 20:19:19 -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 1rbsIg-0003Zi-Rm; Sun, 18 Feb 2024 20:18:33 -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 1rbsIe-0004L2-N7; Sun, 18 Feb 2024 20:18:30 -0500 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-6080a3eecd4so16645997b3.2; Sun, 18 Feb 2024 17:18:26 -0800 (PST) Received: from localhost.localdomain ([201.203.117.224]) by smtp.gmail.com with ESMTPSA id m12-20020a819e0c000000b00607ff905ed3sm1204704ywj.58.2024.02.18.17.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 17:18:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708305506; x=1708910306; 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=DtsuwPzS9320XgK1GXMbILQYF1mg0bz1zde+3meZxwh5gtaYdXei8K3jNrJyHyF8aM 7oWVHth/Ic0ojDj4W7ddkldFbJ6UQ+AONnQXSdrzJRYSQ0ewy+RzVx107f2VIaCuOiTi j/1IdY30+t0jOXhPLnxA4MvEnTVp1W7B7IAgBGSt1OektwTGuvyhlhXMXVzGDR5Z5swP kh7VE/NuwzOG6X8H/kMzMCACTUfqslM9jjDrHZGzu6X/y+8cnU/0wZolFySSQjglePP/ AdHr5+jbOPCRf2/oOYxTao3NsYD727VufMPLDpi+6ZL5gVUzaXdaPueBu2jsdv+tSOyW UKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708305506; x=1708910306; 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=e+4K3gR5ZxkExDQ+6ax5xPeruYEKoH1H+ZmvRmt8RznVv7JPaifiXiG5lDsaMey+Fo Na6z19bgbohgL2fqoKdnNBZYjzGTCmZOUxVyo1As4wudfvzOy//1xydgm2mGCxNGL81N zWhSoum0PvEwgQ50P+qs1xNqeEHRjjV22LV9nPC7aJx7btTN5+wglNfoUImej+mJO1WF fNAVYA1tJ5a37+4fug1Oc3mWz3EwZnO/9ExOv2YU54tJKwMUvSHmCNkHv8nq6RMwXsbk aFoWSNixj6KyDaq4Xhv7MHmZJWprPLE249hYxFMQ0NZ8g0y9RVwVf3mcflG2szFZPjDw +Adg== X-Gm-Message-State: AOJu0Yz3D/nkWxdE4ypenue7QXU/6NJuP8cldfEriBv4oHGiCGgkHqJz Mv1qtlWCxIvqwf5X1b7JC4xXtPWp1bc0rPI3K6dZvV+haDENcBUmSZhLiqaCHU0= X-Google-Smtp-Source: AGHT+IEIL2m9lUVUqTgxHSV9QFUhf/Mpacy0rwhvpOdAtWqgDb8OGsgmva8CS1nb2TsF+hwHvX152A== X-Received: by 2002:a81:ad1f:0:b0:607:b0d3:ebc0 with SMTP id l31-20020a81ad1f000000b00607b0d3ebc0mr10602186ywh.21.1708305505974; Sun, 18 Feb 2024 17:18:25 -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 v5 37/41] Add mailbox property tests. Part 2 Date: Sun, 18 Feb 2024 19:17:35 -0600 Message-Id: <20240219011739.2316619-38-sergey.kambalin@auriga.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240219011739.2316619-1-sergey.kambalin@auriga.com> References: <20240219011739.2316619-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: 1708305905689100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Sergey Kambalin --- 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