Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E68C5C001DF for ; Sun, 6 Aug 2023 17:53:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C47F18688C; Sun, 6 Aug 2023 19:52:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AvUxMIh9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 439E986857; Sun, 6 Aug 2023 19:52:55 +0200 (CEST) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4921B867E7 for ; Sun, 6 Aug 2023 19:52:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51bece5d935so5271997a12.1 for ; Sun, 06 Aug 2023 10:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691344373; x=1691949173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bxLun/IMTTyxIze7X+jNwFBAftcmEXYSPcEWDswEHgg=; b=AvUxMIh9a6V+4pNvCVkHxv5L8+k8t1wChImSW+dySOtAIcwgpUzZiWR/h5xpUuI9gc ahYcGZ2wSoyyOLhPJf3DD+njcUSwxLZ1vcEBZueWzao3VxxyTI5caN8V90ZoVA7ZDPcQ 38gkb2mzvCHtDodPVwCIDo/LxJVkLPo6nadp6AZQJwgJKV2Z4VEuyPi9UUxGVsmaVc/Z SJV38yu+tlzCLfI9caKkopXtYhrPRUmzFLEBZOPiXjVDRbc6xTLeen0K8voY4zCjytqo 6ZFkcIkIgKiJSEbbcIlwjP2GarocOYNe9Qw+FVTaZCnY8YvhWV/xj0DTa2LDZ6lm04Vt Xp4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691344373; x=1691949173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bxLun/IMTTyxIze7X+jNwFBAftcmEXYSPcEWDswEHgg=; b=Qy4chBrcbhl12qaL4+3Kd8mtVREolk3J+y06nvisjtkTJMwOYCrRWb1QrXnOsbzXhm OBh4U9XpWiOWtymkwOHH1pbx4+aqhE90nw5YpDEhzcA6Ado6hls8sL7GwIQCmle17bnV ZG9BDUtE57fns0WtHebtYZ4UboaAyX3bMcwC0DngViq3MiPqH6XHo304jkRzS6B4ueTs k8RqDrJLqE4wMO6tK7UOFvNkAF9xXFTzPYdwxV/jEZdUtO+E5cwE/I43nR1CHs7LeFPB uqsSoB/UYThUbhlPTa+nsP3tGEaxLQgCbcYUxSb9kRRPXk1SAxpajNfo4Qe8xYgkMu9T Hs/g== X-Gm-Message-State: AOJu0YxDLfJuK4Fihk25wGaHDMLQsOFxkv7O0k93qScwWyr3iYUiEO0m a8ejhnPBm1U67XFIJj8AbLLVSO3OM3QJrw== X-Google-Smtp-Source: AGHT+IGCWYIyipf3rcPqcOw6eEfsnOMxN9N4Bnx9f2lynf1ROU13kDix6SxtMct25Sn3YtLYOpW1Gw== X-Received: by 2002:a17:906:847b:b0:992:872:76d4 with SMTP id hx27-20020a170906847b00b00992087276d4mr6733093ejc.17.1691344372671; Sun, 06 Aug 2023 10:52:52 -0700 (PDT) Received: from xeon.. ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id la4-20020a170906ad8400b0099bd682f317sm4066454ejb.206.2023.08.06.10.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 10:52:52 -0700 (PDT) From: Svyatoslav Ryhel To: Jaehoon Chung , Simon Glass , Jonas Karlman , Svyatoslav Ryhel , Eugen Hristev , Patrice Chotard , John Keeping Cc: u-boot@lists.denx.de Subject: [PATCH v3 4/4] test: dm: regulator: provide test of auto setup Date: Sun, 6 Aug 2023 20:52:24 +0300 Message-Id: <20230806175224.103002-5-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230806175224.103002-1-clamor95@gmail.com> References: <20230806175224.103002-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Adjust existing tests to pass with autosetup and so test if changes behave as expected. Signed-off-by: Svyatoslav Ryhel --- test/dm/regulator.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/dm/regulator.c b/test/dm/regulator.c index 33115daaf5..fbbbddbf72 100644 --- a/test/dm/regulator.c +++ b/test/dm/regulator.c @@ -168,7 +168,8 @@ static int dm_test_power_regulator_set_get_enable(struct unit_test_state *uts) /* Set the Enable of LDO1 - default is disabled */ platname = regulator_names[LDO1][PLATNAME]; ut_assertok(regulator_get_by_platname(platname, &dev)); - ut_assertok(regulator_set_enable(dev, val_set)); + /* LDO1 has boot-on property so enable should return -EALREADY */ + ut_asserteq(regulator_set_enable(dev, val_set), -EALREADY); /* Get the Enable state of LDO1 and compare it with the requested one */ ut_asserteq(regulator_get_enable(dev), val_set); @@ -187,7 +188,8 @@ int dm_test_power_regulator_set_enable_if_allowed(struct unit_test_state *uts) /* Get BUCK1 - always on regulator */ platname = regulator_names[BUCK1][PLATNAME]; - ut_assertok(regulator_autoset_by_name(platname, &dev_autoset)); + /* BUCK1 has always-on property so autoset should return -EALREADY */ + ut_asserteq(regulator_autoset_by_name(platname, &dev_autoset), -EALREADY); ut_assertok(regulator_get_by_platname(platname, &dev)); /* Try disabling always-on regulator */ @@ -307,7 +309,8 @@ static int dm_test_power_regulator_autoset(struct unit_test_state *uts) * Expected output state: uV=1200000; uA=200000; output enabled */ platname = regulator_names[BUCK1][PLATNAME]; - ut_assertok(regulator_autoset_by_name(platname, &dev_autoset)); + /* BUCK1 has always-on property so autoset should return -EALREADY */ + ut_asserteq(regulator_autoset_by_name(platname, &dev_autoset), -EALREADY); /* Check, that the returned device is proper */ ut_assertok(regulator_get_by_platname(platname, &dev)); -- 2.39.2