devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Beisswenger <johannes.beisswenger-QHh2hmjso9JBDgjK7y7TUQ@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Johannes Beisswenger
	<johannes.beisswenger-QHh2hmjso9JBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH 2/3] tests: Add test cases for bad endpoint node and remote-endpoint prop checks
Date: Fri, 28 Apr 2023 15:38:33 +0200	[thread overview]
Message-ID: <20230428133834.78178-2-johannes.beisswenger@cetitec.com> (raw)
In-Reply-To: <20230428133834.78178-1-johannes.beisswenger-QHh2hmjso9JBDgjK7y7TUQ@public.gmane.org>

Signed-off-by: Johannes Beisswenger <johannes.beisswenger-QHh2hmjso9JBDgjK7y7TUQ@public.gmane.org>
---
 tests/bad-graph-root1.dts |  7 +++++++
 tests/bad-graph-root2.dts |  2 ++
 tests/bad-graph-root3.dts | 14 ++++++++++++++
 tests/bad-graph-root4.dts | 19 +++++++++++++++++++
 tests/run_tests.sh        |  4 ++++
 5 files changed, 46 insertions(+)
 create mode 100644 tests/bad-graph-root1.dts
 create mode 100644 tests/bad-graph-root2.dts
 create mode 100644 tests/bad-graph-root3.dts
 create mode 100644 tests/bad-graph-root4.dts

diff --git a/tests/bad-graph-root1.dts b/tests/bad-graph-root1.dts
new file mode 100644
index 0000000..06cf915
--- /dev/null
+++ b/tests/bad-graph-root1.dts
@@ -0,0 +1,7 @@
+/dts-v1/;
+
+/ {
+	foo {
+                remote-endpoint = <0xdeadbeef>;
+	};
+};
diff --git a/tests/bad-graph-root2.dts b/tests/bad-graph-root2.dts
new file mode 100644
index 0000000..026f207
--- /dev/null
+++ b/tests/bad-graph-root2.dts
@@ -0,0 +1,2 @@
+/dts-v1/;
+/ {	endpoint {};  };
diff --git a/tests/bad-graph-root3.dts b/tests/bad-graph-root3.dts
new file mode 100644
index 0000000..7360013
--- /dev/null
+++ b/tests/bad-graph-root3.dts
@@ -0,0 +1,14 @@
+/dts-v1/;
+
+ / {
+	bar: bar {
+		port {
+			bar_con: endpoint {
+				remote-endpoint = <&foo_con>;
+			};
+		};
+	};
+	foo_con: endpoint {
+		remote-endpoint = <&bar_con>;
+	};
+};
diff --git a/tests/bad-graph-root4.dts b/tests/bad-graph-root4.dts
new file mode 100644
index 0000000..5b1a1ea
--- /dev/null
+++ b/tests/bad-graph-root4.dts
@@ -0,0 +1,19 @@
+/dts-v1/;
+
+ / {
+
+	bar: bar {
+		port {
+			bar_con: endpoint {
+				remote-endpoint = <&foo_con>;
+			};
+		};
+	};
+	foo {
+		remote-endpoint = <&bar_con>; // misplaced remote-endpoint property
+		port {
+			foo_con: endpoint {
+			};
+		};
+	};
+};
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index f899d8c..2af8c15 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -730,6 +730,10 @@ dtc_tests () {
     check_tests "$SRCDIR/bad-graph.dts" graph_child_address
     check_tests "$SRCDIR/bad-graph.dts" graph_port
     check_tests "$SRCDIR/bad-graph.dts" graph_endpoint
+    check_tests "$SRCDIR/bad-graph-root1.dts" graph_nodes
+    check_tests "$SRCDIR/bad-graph-root2.dts" graph_nodes
+    check_tests "$SRCDIR/bad-graph-root3.dts" graph_nodes
+    check_tests "$SRCDIR/bad-graph-root4.dts" graph_nodes
     run_sh_test "$SRCDIR/dtc-checkfails.sh" deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/bad-gpio.dts"
     run_sh_test "$SRCDIR/dtc-checkfails.sh" -n deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/good-gpio.dts"
     check_tests "$SRCDIR/bad-interrupt-cells.dts" interrupts_property
-- 
2.40.0


  parent reply	other threads:[~2023-04-28 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28 13:38 [PATCH 1/3] checks: Fix segmentation fault in check_graph_node Johannes Beisswenger
     [not found] ` <20230428133834.78178-1-johannes.beisswenger-QHh2hmjso9JBDgjK7y7TUQ@public.gmane.org>
2023-04-28 13:38   ` Johannes Beisswenger [this message]
2023-04-28 13:38   ` [PATCH 3/3] checks: Fix crash in graph_child_address if 'reg' cell size > 1 Johannes Beisswenger

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=20230428133834.78178-2-johannes.beisswenger@cetitec.com \
    --to=johannes.beisswenger-qhh2hmjso9jbdgjk7y7tuq@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).