From patchwork Fri Dec 15 15:13:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wajdeczko X-Patchwork-Id: 754711 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6767D3FE44 for ; Fri, 15 Dec 2023 15:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n1bagiSq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702653224; x=1734189224; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UXAqKDnLJZFCXaf2Fb2e7GjEWeMKLKBSsFBT7sI4xhE=; b=n1bagiSq7PM6tiZNtLD9+amh3T/xPGNBPkhng3HLpsbuHVe4Jcn3jiMP 7ica/7T71VzvLejPctgA7ZnJoisy2+j55z6ZRMhb1WIwXwAoeCSg945NM 2jwPd8D6a+bjd5m/ogfkgoytt9SvfzLRE6XPQJqZwhWXQt+y1+uUuLiNr nUCsGmnI2tk1zpFlf5eYdyvvlm+COjGxxvZkxJsOhp9JeS9X0yMgbt6n6 LmVfNiLoTMpfTq5znENdcEQQbfKxrkdsbd+YeekUdREbf/A7zb16sw9GG 5FbdMKyE9ief0kraIMTGjnK1HLkdKWez5SBQwX2MENdMPl1mBKKhKaf9f w==; X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="8645414" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="8645414" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 07:13:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="840692227" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="840692227" Received: from mwajdecz-mobl.ger.corp.intel.com ([10.249.144.211]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 07:13:41 -0800 From: Michal Wajdeczko To: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Cc: Michal Wajdeczko , David Gow , Rae Moar Subject: [PATCH 0/2] kunit: Reset test->priv after each param iteration Date: Fri, 15 Dec 2023 16:13:25 +0100 Message-Id: <20231215151327.1835-1-michal.wajdeczko@intel.com> X-Mailer: git-send-email 2.21.0 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If we run parameterized test that uses test->priv to prepare some custom data, then value of test->priv will leak to the next param iteration and may be unexpected. Cc: David Gow Cc: Rae Moar Michal Wajdeczko (2): kunit: Add example for using test->priv kunit: Reset test->priv after each param iteration lib/kunit/kunit-example-test.c | 15 +++++++++++++++ lib/kunit/test.c | 1 + 2 files changed, 16 insertions(+)