From nobody Thu Oct 30 15:22:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525450194118466.02070802066294; Fri, 4 May 2018 09:09:54 -0700 (PDT) Received: from localhost ([::1]:35090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdHN-00021e-Cn for importer@patchew.org; Fri, 04 May 2018 12:09:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEd8B-0003LK-KK for qemu-devel@nongnu.org; Fri, 04 May 2018 12:00:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEd8A-0001re-Tt for qemu-devel@nongnu.org; Fri, 04 May 2018 12:00:23 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:39876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEd8A-0001rY-Pi for qemu-devel@nongnu.org; Fri, 04 May 2018 12:00:22 -0400 Received: by mail-qt0-x242.google.com with SMTP id f1-v6so27975297qtj.6 for ; Fri, 04 May 2018 09:00:22 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id a83sm8587066qkb.22.2018.05.04.09.00.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 09:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eGdYr9/tFaRW/A3pStKqBr23EMRjp4nXGM+Jhc6/0tg=; b=tzgaVhLVhSCT1Zyde67aQmUt1+DOC3+VSYRqysT2OZzcDQ6h3vaYhr4kUrg3ZctxEG 064ijQWgfUxlTXN5OWUc/cKjWwjENqu5XcayXAossHRWMT/gJuqqPf5t1eIzwWDxR0v0 FxXheEDBUqwBWZ7cIdlvwJlvd3wsmrl5xUxxO6K2mVWzr7RgQWnAT/54wbkviRRT/pYV d21jUKK1dCfS+/GWpdeJJVx+Uzdc6Po4O77Mz7E+2M7U70/77zCvLyvGKryHYdTSimn5 pWK7Z1mDZDw4dYYCNmwDM9DvgrtW3KllRR9nnx7fRiPnZdZaH7mCMjBI6cCzyhuvHJmC eszg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eGdYr9/tFaRW/A3pStKqBr23EMRjp4nXGM+Jhc6/0tg=; b=VQiErBTVI1PKNfFgIYwLyCep+JaPVTq62tLDZyvZB0ZkW17UpHp3UW3G/y+FwV2cAP TCSMfMB5jOZVFoS6JayB9TGo/YmOI9Ei3mmAMkKeHx+9otwAUN3w0eV/eu1HtvnRsxwn u75Uwpp16ua/ATIUTFiycN6fwN69aJoVm+7bVqtLv5b0y06YlOJoiQKWuXAgCtJ1wjP7 g2gj9Stpfr2T24jB8HbufDjNQBGST6JhPnJeAbFg0eWfzdoFU+DdCMwdk6KLA742QAN/ ApJZe8qIizJc1vUJY8qUNdWk0ifz0aSy2xn8CZUnvSYUI/lXITl6w+SIDMwHu7uZsB8D arzg== X-Gm-Message-State: ALQs6tBHJcfOAQdQHQb57NmyJdp4gr24HFaGUjSrxRnvAr+qLCinNLLy 9iRheU9lSpyBBh826wzt9+E= X-Google-Smtp-Source: AB8JxZqi2UvbGEQOehK+O69JbjXs00nFeC4AAuP1pL0Wpf+jqgCR8TU5I6XeVnTfIKOdEgmV8BafgA== X-Received: by 2002:a0c:b2c2:: with SMTP id d2-v6mr8190008qvf.16.1525449622276; Fri, 04 May 2018 09:00:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , "Edgar E . Iglesias" Date: Fri, 4 May 2018 12:59:17 -0300 Message-Id: <20180504155918.21287-20-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504155918.21287-1-f4bug@amsat.org> References: <20180504155918.21287-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 19/20] sdcard: Add test_sd_data_frame_crc16() qtest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/sdcard-test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/sdcard-test.c b/tests/sdcard-test.c index efcfbfc033..c51e8095b6 100644 --- a/tests/sdcard-test.c +++ b/tests/sdcard-test.c @@ -78,6 +78,15 @@ static void test_sd_response_frame136_crc7(void) g_assert_cmphex(frame.crc, =3D=3D, 0xad); } =20 +static void test_sd_data_frame_crc16(void) +{ + SDFrameData frame; + + memset(frame.content, 0xff, sizeof(frame.content)); + sd_update_framedata_checksum(&frame); + g_assert_cmphex(frame.crc, =3D=3D, 0x7fa1); +} + int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); @@ -85,6 +94,7 @@ int main(int argc, char *argv[]) qtest_add_func("sd/req_crc7", test_sd_request_frame_crc7); qtest_add_func("sd/resp48_crc7", test_sd_response_frame48_crc7); qtest_add_func("sd/resp136_crc7", test_sd_response_frame136_crc7); + qtest_add_func("sd/data_crc16", test_sd_data_frame_crc16); =20 return g_test_run(); } --=20 2.17.0