]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
fsx: fix indenting of columns in bad buffers report
authorDarrick J. Wong <djwong@kernel.org>
Tue, 2 May 2023 20:08:11 +0000 (13:08 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 14 May 2023 13:48:06 +0000 (21:48 +0800)
commit8c5f19b701eae8c9a255ed51cd12ad18c88259fa
tree26d698cc714f187d3e42866079b338c78249e59d
parente35817daa103d6c8dd670fc0acef7f2247e10a9f
fsx: fix indenting of columns in bad buffers report

When file corruption is detected, make the columns of the report line
up correctly even in the diff output.  Although the .out.bad file
contains this (with spaces to demonstrate unequivocally what happens
when tabs are formatted as 8-column indent):

OFFSET  GOOD    BAD     RANGE
0x2c000 0x0000  0xd6c1  0x00000

diffing the good and bad golden output yields poorly formatted output:

+OFFSET GOOD    BAD     RANGE
+0x2c000        0x0000  0xd6c1  0x00000

Replace the tabs with columns indented with printf width specifiers so
that the test output gets this:

OFFSET      GOOD    BAD     RANGE
0x2c000     0x0000  0xd6c1  0x0

...which always lines up the columns regardless of the user's tab
display settings or diff inserting plus signs.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
ltp/fsx.c