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] test/py: hush_if_test: Add tests to cover octal/hex values
Date: Thu, 10 Oct 2019 13:44:38 +0200	[thread overview]
Message-ID: <2861e9ee042ad93a9d36f551cd90ce7cbc6030aa.1570707876.git.michal.simek@xilinx.com> (raw)

Extend test suite to cover also automatic octal/hex converstions which
haven't been implemented in past.

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

Depends on https://lists.denx.de/pipermail/u-boot/2019-September/383309.html

There are of course other tests which we can run but not sure if make sense
to have there all combinations. The most interesting are mixed tests which
are failing before patch above is applied.
Definitely please let me know if you want to add any other test.
---
 test/py/tests/test_hush_if_test.py | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/test/py/tests/test_hush_if_test.py b/test/py/tests/test_hush_if_test.py
index bba8d41d9648..252e8d1521ed 100644
--- a/test/py/tests/test_hush_if_test.py
+++ b/test/py/tests/test_hush_if_test.py
@@ -52,6 +52,33 @@ subtests = (
     ('test 123 -ge 123', True),
     ('test 123 -ge 456', False),
 
+    # Octal tests
+
+    ('test 010 -eq 010', True),
+    ('test 010 -eq 011', False),
+
+    ('test 010 -ne 011', True),
+    ('test 010 -ne 010', False),
+
+    # Hexadecimal tests
+
+    ('test 0x2000000 -gt 0x2000001', False),
+    ('test 0x2000000 -gt 0x2000000', False),
+    ('test 0x2000000 -gt 0x1ffffff', True),
+
+    # Mixed tests
+
+    ('test 010 -eq 10', False),
+    ('test 010 -ne 10', True),
+    ('test 0xa -eq 10', True),
+    ('test 0xa -eq 012', True),
+
+    ('test 2000000 -gt 0x1ffffff', False),
+    ('test 0x2000000 -gt 1ffffff', True),
+    ('test 0x2000000 -lt 1ffffff', False),
+    ('test 0x2000000 -eq 2000000', False),
+    ('test 0x2000000 -ne 2000000', True),
+
     ('test -z ""', True),
     ('test -z "aaa"', False),
 
-- 
2.17.1

             reply	other threads:[~2019-10-10 11:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 11:44 Michal Simek [this message]
2019-10-10 15:56 ` [U-Boot] [PATCH] test/py: hush_if_test: Add tests to cover octal/hex values Stephen Warren
2019-10-10 16:40   ` Simon Goldschmidt
2019-10-10 17:06 ` Simon Glass
2019-10-11  6:50   ` Michal Simek
2019-10-11 15:53     ` Simon Glass
2019-10-15  6:08       ` Michal Simek
2019-10-21 22:53         ` Simon Glass
2019-10-21 23:04           ` Stephen Warren
2019-10-21 23:46             ` Simon Glass
2019-10-22 15:54               ` Stephen Warren
2019-10-24  6:50                 ` Michal Simek
2019-10-30  1:48                   ` Simon Glass

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=2861e9ee042ad93a9d36f551cd90ce7cbc6030aa.1570707876.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.