]> granicus.if.org Git - strace/commit
tests: add checks for dumpstr output into read-write test
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 20 Feb 2019 13:52:59 +0000 (14:52 +0100)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 21 Feb 2019 00:18:38 +0000 (01:18 +0100)
commit66149607ca0beb39d86cbd686144f5674be1a849
treef0e2c262c4c98d1cbd945fa61379bdd8a6821e2c
parent79acbcf2550f3a55108240558efb8b9c36eb8399
tests: add checks for dumpstr output into read-write test

util.c:dumpstr() now aligns offsets in accordance with the total length
of the dump and also may perform only partial dump, so let's add checks
for these cases.

* tests/fill_memory.c (fill_memory_ex): Change the type of the period
argument from unsigned char to unsigned int.
* tests/tests.h (fill_memory_ex): Likewise.
* tests/read-write.c (dump_str_ex): Rename from dump_str, add idx_w
argument, support len greater than 240 bytes.
(dump_str): New function, wrapper for dump_str_ex with the default index
width.
(print_hex): Add checks for dumpstr output, close fd 1 later.
tests/fill_memory.c
tests/read-write.c
tests/tests.h