]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test: py: DDR address for writing data back is also randomized
authorMichal Simek <michal.simek@xilinx.com>
Fri, 19 Jan 2018 09:43:05 +0000 (10:43 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 31 Jan 2018 12:15:50 +0000 (13:15 +0100)
Make sure that test is using diferent offsets for reading data back.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_qspi.py

index 474446165907bd9e43715ee83026225eb1b3a78c..ebce1b89a14f8cc9cea7a92610117de71de3930d 100644 (file)
@@ -152,6 +152,7 @@ def qspi_write_twice(u_boot_console):
     old_size = 0
     # TODO maybe add alignment and different start for pages
     for size in random.randint(4, page_size), random.randint(page_size, total_size), total_size:
+        offset = random.randint(4, page_size)
         addr = u_boot_utils.find_ram_base(u_boot_console)
         size = size - old_size
         output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size, size))
@@ -163,9 +164,9 @@ def qspi_write_twice(u_boot_console):
         # print expected_crc32
         output = u_boot_console.run_command('sf write %x %x %x' % (addr + total_size, old_size, size))
         assert expected_write in output
-        output = u_boot_console.run_command('sf read %x %x %x' % (addr + total_size + 10, old_size, size))
+        output = u_boot_console.run_command('sf read %x %x %x' % (addr + total_size + offset, old_size, size))
         assert expected_read in output
-        output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size + 10, size))
+        output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size + offset, size))
         assert expected_crc32 in output
         old_size = size