Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1239143pxa; Thu, 6 Aug 2020 03:07:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0FjCIXe1dC2G4C6vfmg6djRQ6vAIdNKv6wrjazNaGjZZXpbNGK1wjFondxPbyGT4ztrJQ X-Received: by 2002:a17:906:a2c2:: with SMTP id by2mr3495458ejb.86.1596708436678; Thu, 06 Aug 2020 03:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596708436; cv=none; d=google.com; s=arc-20160816; b=0ZxLWn0sFTs8NuRAlbDnOzLzr5WUsmeXsXZBVzkASbuo4rBgR7R6Sv1tTDUAJC3kFu Asj/Snsk2jSBpTJKthtZnORX2VnlbvSXHEzfkygV1LPJNNwrLlG5QHujB8AtLhcZkXik ++TrCHO50K0Uds6Z1+cbDCSNSyRQJarPN9tjyz6gCi6ObH8UVXwGqwgAvXm6t48nJm1y vIAYx1CxZ3QmsJ6ITlZFu6CSByA8bqKgE1HuIMqE6ksy/RNV4782838j/RdUU2gAt0cc 5YuA4HRF1WxWbqnjdkUOwc+uDq63Hkgnd9PTA10LjoS8+m/RUaae09kc+DMLvg4wlcjA 4XSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=J/kRZWTZ/jOaVMmm+B9OLwXkZE3xFLIsh7uY71cghrE=; b=hLq9l8O1Kvn05GLq7hDYzWRyiEYOBegAiwJqljDGNMW6t4cWNqz+PyfaSYGxB/poag XVFuRNPT/NmiWtQLMbzxKbqJp4DEjOiUC2LgOGzq+0oNWcvq/oSQzQZ8nd+LThDDa6Tr YVzg7MbYoLY/tC2roKG1HyRt1jZub7FE3Xs/67NKvHT6andnxMH5mn6e53SMYM2ONWk0 /6amAXh6OWkcwPgq3eldfb9hdB1zGHozUK4QukjXSXTBv1M+N09FSrXQeFcGwuEGrqIC cyZuIV/PpbdIu4KCgowpM/dFxlvjvMH8Us4R4Cde5josmlfgSHeIQrZ8H64gBo8uYeC/ hLeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx7si2834894ejb.752.2020.08.06.03.06.50; Thu, 06 Aug 2020 03:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729351AbgHFKGA (ORCPT + 99 others); Thu, 6 Aug 2020 06:06:00 -0400 Received: from mga03.intel.com ([134.134.136.65]:7947 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729146AbgHFKFp (ORCPT ); Thu, 6 Aug 2020 06:05:45 -0400 IronPort-SDR: M2ASli/YHeQq9vVP6jKxQOx845Gy9NNDGM+EEdB/4FcneqSCZr5Qdt2YxwDQ5kquEDjaTG7sYW ANY+Hq9MBALA== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="152725388" X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="152725388" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 03:05:45 -0700 IronPort-SDR: rE3lJhlRUXmwvLUip+sH/wzJoWOMlybFBgk21RUiVATUNM9Yo0xhByxdA6k/S9SOSHDpi+iupS 1254V3QJHu8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="275037615" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga007.fm.intel.com with ESMTP; 06 Aug 2020 03:05:42 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1k3cmK-006p2q-Lr; Thu, 06 Aug 2020 13:05:40 +0300 Date: Thu, 6 Aug 2020 13:05:40 +0300 From: Andy Shevchenko To: Arpitha Raghunandan <98.arpi@gmail.com> Cc: brendanhiggins@google.com, skhan@linuxfoundation.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] lib: Convert test_hexdump.c to KUnit Message-ID: <20200806100540.GE3703480@smile.fi.intel.com> References: <20200806094440.14962-1-98.arpi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200806094440.14962-1-98.arpi@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 06, 2020 at 03:14:40PM +0530, Arpitha Raghunandan wrote: > Converts test lib/test_hexdump.c to KUnit. > More information about KUnit can be found at > https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html. > KUnit provides a common framework for unit tests in the kernel. ... > - if (memcmp(test, real, TEST_HEXDUMP_BUF_SIZE)) { > - pr_err("Len: %zu row: %d group: %d\n", len, rowsize, groupsize); > - pr_err("Result: '%s'\n", real); > - pr_err("Expect: '%s'\n", test); > - failed_tests++; > - } > + KUNIT_EXPECT_EQ(kunittest, 0, memcmp(test, real, TEST_HEXDUMP_BUF_SIZE)); Ah, can you explain how user will see now what is being expected and what is in reality in the buffer? I'm not gonna accept such changes without showing in explicitly that user is not going to suffer of this change. -- With Best Regards, Andy Shevchenko