]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - lib/test_hexdump.c
test_hexdump: check all bytes in real buffer
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 20 Jan 2016 22:59:01 +0000 (14:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Jan 2016 01:09:18 +0000 (17:09 -0800)
commitcc77a719a5cfd419d057277fd0fdfca568bcfdd2
tree3119fe81cd39c472859ca4d223d59632a0e69f2b
parent7047d813718c8e40929b7267a8d20cbf212f8565
test_hexdump: check all bytes in real buffer

After processing by hex_dump_to_buffer() check all the parts to be expected.

Part 1. The actual expected hex dump with or without ASCII part.

Part 2. Check if the buffer is dirty beyond needed.

Part 3. Return code should be as expected.

This is done by using comparison of the return code and memcmp() against
the test buffer.  We fill the buffer by FILL_CHAR ('#') characters, so, we
expect to have a tail of the buffer will be left untouched.  The
terminating NUL is also checked by memcmp().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/test_hexdump.c