]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit242c1b88220b9f8eda0d9d5947870e110e94c2a5
tree3119fe81cd39c472859ca4d223d59632a0e69f2b
parenteabca5d54b60732dd3c4223202f1ea992c3461e1
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