From patchwork Fri May 4 15:59:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10381027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 26C8B603B4 for ; Fri, 4 May 2018 16:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F609294E5 for ; Fri, 4 May 2018 16:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04188294EA; Fri, 4 May 2018 16:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 78C02294E5 for ; Fri, 4 May 2018 16:17:13 +0000 (UTC) Received: from localhost ([::1]:35181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdOS-0008SL-NX for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 May 2018 12:17:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEd83-0003Dp-U2 for qemu-devel@nongnu.org; Fri, 04 May 2018 12:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEd83-0001oE-6c for qemu-devel@nongnu.org; Fri, 04 May 2018 12:00:16 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:34705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEd83-0001o5-2w for qemu-devel@nongnu.org; Fri, 04 May 2018 12:00:15 -0400 Received: by mail-qk0-x244.google.com with SMTP id p186so16986223qkd.1 for ; Fri, 04 May 2018 09:00:14 -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=1tXqRiiL0C0W9LLotz7Ff+Lmj7/vRdAmwabrSiTxHb4=; b=Iq7vWkGrDuB9ttLkdDvTnvP3Sp3Hx7b/VryhuoWXstBrmY6qaGdEMNKf4rpnCChhvf 1pSPRJ85UjZz+bqANc4kkp3ehPc+++oL8v1KFlY7kwTB/6kAvBiM0dtxiwiK8v2aHiIa 8XaeI9TUeAM81zYbXSdPSKkGGeZgpN4wfobCpbo3ZH2zXrt0B9CME1+oM+HRYLr5/oFR XXT+76p6TtSquTFrlLPoKVfbZRIy8Wn4GCKJXq1pOLQGP6wx8RUdhmf4TxkPtJ+0iGsg mLLMtcB9RVtzxb8i9ix6VthA2DA1/53gsUWuo6Ji9tKiY7lCswcPEt2Gee+1pesk/ZeA di9A== 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=1tXqRiiL0C0W9LLotz7Ff+Lmj7/vRdAmwabrSiTxHb4=; b=OU1eN33+pgPdY3gzpl11iBgOQy6ypBY92+Z162IVRvQ8wmwOXjKYBXouWaRLeqPJrN e7hDNOHo6dwimzrjwq/yp5Ezf3L8IUoa7iLnpB4rhMUWxvWXG3vXM4zOrdC20z7hK1Pm KqwLa+6DPIHOzl5G9NfCqorz9FAjKZoXxg8QnSysDjhfpB72IFChLfOoyyPi7QyYk2oc a6/T+58nOFMW7MHAxhNCigAlG0vldqmf1enk9c2/Q150XbkU+I3hqBA4w5lmG62SIlf8 x5xYlW3DdgM6NOiBuk4rbn6jEmhjGV5Qpk1Y6FCid9iBE1Vi1p53WookxqpezQ59RE45 8DQw== X-Gm-Message-State: ALQs6tDBOEVEnTHhRdlyDdKKPJzJn4CHIpS2YQhNKWm1PH4Juc1ch3vH B9VxfOJNHndc+vMpLUTwUbw= X-Google-Smtp-Source: AB8JxZpD8jbUIKLWyAX+U8unZNgeT60HCldwXYm40/OZSDzZpiacCS2onOMsllRah1qiYKH7BqCFvQ== X-Received: by 10.55.144.131 with SMTP id s125mr21646346qkd.42.1525449614252; Fri, 04 May 2018 09:00:14 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id a83sm8587066qkb.22.2018.05.04.09.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 09:00:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , "Edgar E . Iglesias" Date: Fri, 4 May 2018 12:59:14 -0300 Message-Id: <20180504155918.21287-17-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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 16/20] sdcard: Add test_sd_response_frame136_crc7() 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Philippe Mathieu-Daudé --- tests/sdcard-test.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/sdcard-test.c b/tests/sdcard-test.c index 2de0a5a0ee..efcfbfc033 100644 --- a/tests/sdcard-test.c +++ b/tests/sdcard-test.c @@ -66,12 +66,25 @@ static void test_sd_response_frame48_crc7(void) g_assert_cmphex(frame.crc, ==, 0x0c); } +static void test_sd_response_frame136_crc7(void) +{ + SDFrame136 frame; + + /* response to CMD2 ALL_SEND_CID */ + memcpy(&frame.content, + "\x1d\x41\x44\x53\x44\x20\x20\x20\x10\xa0\x40\x0b\xc1\x00\x88", + sizeof(frame.content)); + sd_update_frame136_checksum(&frame); + g_assert_cmphex(frame.crc, ==, 0xad); +} + int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); 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); return g_test_run(); }