All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/7] dm: core: Add tests for dev_read_alias_highest_id()
Date: Thu, 31 Jan 2019 16:31:00 +0100	[thread overview]
Message-ID: <6acaec7fd5c7cff1f1a8e803d949d9efb7e3ff9b.1548948659.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <cover.1548948659.git.michal.simek@xilinx.com>

It is checking the highest alias ID for eth, gpio, pci, i2c and error
code on non existing alias.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2:
- New patch

 test/dm/test-fdt.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 984b80c02c81..be16c99e170e 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -219,6 +219,29 @@ static int dm_test_fdt(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_fdt, 0);
 
+static int dm_test_alias_highest_id(struct unit_test_state *uts)
+{
+	int ret;
+
+	ret = dev_read_alias_highest_id("eth");
+	ut_asserteq(5, ret);
+
+	ret = dev_read_alias_highest_id("gpio");
+	ut_asserteq(2, ret);
+
+	ret = dev_read_alias_highest_id("pci");
+	ut_asserteq(2, ret);
+
+	ret = dev_read_alias_highest_id("i2c");
+	ut_asserteq(0, ret);
+
+	ret = dev_read_alias_highest_id("deadbeef");
+	ut_asserteq(-1, ret);
+
+	return 0;
+}
+DM_TEST(dm_test_alias_highest_id, 0);
+
 static int dm_test_fdt_pre_reloc(struct unit_test_state *uts)
 {
 	struct uclass *uc;
-- 
1.9.1

  parent reply	other threads:[~2019-01-31 15:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 15:30 [U-Boot] [PATCH v2 0/7] Align U-Boot I2C DM bus ID handling with Linux Michal Simek
2019-01-31 15:30 ` [U-Boot] [PATCH v2 1/7] dm: core: Add of_alias_get_highest_id() Michal Simek
2019-02-07  6:46   ` Heiko Schocher
2019-02-08  4:11     ` Simon Glass
2019-02-11 15:50   ` Heiko Schocher
2019-01-31 15:30 ` [U-Boot] [PATCH v2 2/7] fdt: Introduce fdtdec_get_alias_highest_id() Michal Simek
2019-02-07  6:47   ` Heiko Schocher
2019-02-08  4:11   ` Simon Glass
2019-02-11 15:51   ` Heiko Schocher
2019-01-31 15:30 ` [U-Boot] [PATCH v2 3/7] dm: core: Introduce dev_read_alias_highest_id() Michal Simek
2019-02-07  6:48   ` Heiko Schocher
2019-02-08  4:11   ` Simon Glass
2019-02-11 15:52   ` Heiko Schocher
2019-01-31 15:31 ` Michal Simek [this message]
2019-02-07  6:49   ` [U-Boot] [PATCH v2 4/7] dm: core: Add tests for dev_read_alias_highest_id() Heiko Schocher
2019-02-08  4:11   ` Simon Glass
2019-02-11 15:52   ` Heiko Schocher
2019-01-31 15:31 ` [U-Boot] [PATCH v2 5/7] i2c: dm: Record maximum id of devices before probing devices Michal Simek
2019-02-07  6:49   ` Heiko Schocher
2019-02-11 15:54   ` Heiko Schocher
2019-01-31 15:31 ` [U-Boot] [PATCH v2 6/7] i2c: Fill req_seq in i2c_post_bind() Michal Simek
2019-02-07  6:52   ` Heiko Schocher
2019-02-11 15:54   ` Heiko Schocher
2019-01-31 15:31 ` [U-Boot] [PATCH v2 7/7] i2c: mux: Generate longer i2c mux name Michal Simek
2019-02-02 15:00   ` Simon Glass
2019-02-07  6:55   ` Heiko Schocher
2019-02-11 15:55   ` Heiko Schocher
2019-02-02 14:10 ` [U-Boot] [PATCH v2 0/7] Align U-Boot I2C DM bus ID handling with Linux Simon Glass
2019-02-05  7:57   ` Michal Simek
2019-02-05  8:20     ` Heiko Schocher
2019-02-05  9:04       ` Michal Simek
2019-02-08  4:11     ` Simon Glass
2019-02-08  6:45       ` Michal Simek
2019-02-08  9:57 ` Heiko Schocher
2019-02-08 11:14   ` Michal Simek
2019-02-08 11:24     ` Michal Simek
2019-02-11  6:20       ` Heiko Schocher
2019-02-11  6:58         ` Michal Simek
2019-02-11  8:45           ` Heiko Schocher
2019-02-11 10:06             ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6acaec7fd5c7cff1f1a8e803d949d9efb7e3ff9b.1548948659.git.michal.simek@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.