summaryrefslogtreecommitdiff
path: root/tests/tests.h
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2016-10-02 23:39:11 +0300
committerDmitry V. Levin <ldv@altlinux.org>2016-10-26 01:06:09 +0000
commit06934669ea02ab87ed29afa9487527f2e01339eb (patch)
treea097845a7fa0ac80ef25f846eac6016d18082e09 /tests/tests.h
parentab648c804c3bf362830f11c5e92228f39a89bbb9 (diff)
downloadstrace-06934669ea02ab87ed29afa9487527f2e01339eb.tar.gz
tests: move fill_memory and fill_memory_ex into a separate file
* tests/fill_memory.c: New file. * tests/Makefile.am (libtests_a_SOURCES): Add it. * tests/quotactl.h (fill_memory, fill_memory_ex): Move to fill_memory.c. * tests/tests.h (fill_memory, fill_memory_ex): New prototypes.
Diffstat (limited to 'tests/tests.h')
-rw-r--r--tests/tests.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tests.h b/tests/tests.h
index f3ddc85ed..10bccdbcc 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -67,6 +67,16 @@ void *tail_alloc(const size_t)
void *tail_memdup(const void *, const size_t)
ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2));
+/*
+ * Fill memory (pointed by ptr, having size bytes) with different bytes (with
+ * values starting with start and resetting every period) in order to catch
+ * sign, byte order and/or alignment errors.
+ */
+void fill_memory_ex(char *ptr, size_t size, unsigned char start,
+ unsigned char period);
+/* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */
+void fill_memory(char *ptr, size_t size);
+
/* Close stdin, move stdout to a non-standard descriptor, and print. */
void tprintf(const char *, ...)
ATTRIBUTE_FORMAT((printf, 1, 2));