Message ID | 20180504155918.21287-20-f4bug@amsat.org |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tzgaVhLV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40cxlD6D3Lz9s35 for <incoming@patchwork.ozlabs.org>; Sat, 5 May 2018 02:08:40 +1000 (AEST) Received: from localhost ([::1]:35079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1fEdGA-0000sk-DA for incoming@patchwork.ozlabs.org; Fri, 04 May 2018 12:08:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) 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 <philippe.mathieu.daude@gmail.com>) 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 <philippe.mathieu.daude@gmail.com>) 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 <qemu-devel@nongnu.org>; Fri, 04 May 2018 09:00:22 -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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org> To: Peter Maydell <peter.maydell@linaro.org>, "Edgar E . Iglesias" <edgar.iglesias@xilinx.com> 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: 8bit 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Paolo Bonzini <pbonzini@redhat.com>, Alistair Francis <alistair@alistair23.me>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>, Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
sdcard: proper implementation of CRC
|
expand
|
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, ==, 0xad); } +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, ==, 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); return g_test_run(); }
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- tests/sdcard-test.c | 10 ++++++++++ 1 file changed, 10 insertions(+)