Commit Graph

16 Commits

Author SHA1 Message Date
Jeff Mahoney
f21a2f4119 tests: define PRI__[dux]64 macros to print __s64 and __u64 values
Rather than cast every __u64 or __s64 before printing,
define printing helpers for those types directly.

This complements commit 1f3482beda.

* tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros.
2016-05-22 22:54:23 +00:00
72cb81151f tests: add print_quoted_memory function to libtests
* tests/print_quoted_string.c (print_quoted_memory): New function.
(print_quoted_string): Use it.
* tests/tests.h (print_quoted_memory): New prototype.
2016-05-10 22:12:01 +00:00
a182d8c6c1 tests: add printxval function to libtests
* tests/tests.h (printxval): New prototype.
* tests/printxval.c: New file.
* tests/Makefile.am  (libtests_a_SOURCES): Add it.
2016-04-27 20:31:34 +00:00
121e1961d7 tests: add printflags function to libtests
* tests/printflags.c: New file.
* tests/tests.h (printflags): New prototype.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-04-26 00:13:47 +00:00
2b69fd4c43 tests: add errno2name function to libtests
Add a simple translator of errno to its name, so one could
simply use errno2name() instead of complex expressions like
errno == EINVAL ? "EINVAL" : "EFAULT".

* tests.h (errno2name): New prototype.
* errno2name.c: New file.
* Makefile.am (libtests_a_SOURCES): Add it.
2016-04-21 04:08:55 +03:00
c1f1cc1b4c tests: move kernel uid overflow check to libtests
This code used in two different places, so move it to the library.

* tests/overflowuid.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/tests.h (check_overflowuid, check_overflowgid): New prototypes.
* tests/uid.c (main): Use check_overflowuid.
* tests/uid16.c (main): Likewise.
2016-04-18 01:10:41 +00:00
0de582907a tests: add hexdump_memdup function to libtests
* tests/hexdump_strdup.c (hexdump_memdup): New function.
(hexdump_strdup): Use it.
* tests/tests.h (hexdump_memdup): New prototype.
2016-04-02 18:24:36 +00:00
JayRJoshi
17654da621 tests: add print_quoted_string function to libtests
* tests/tests.h (print_quoted_string): New prototype.
* tests/print_quoted_string.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-03-23 13:34:15 +00:00
7637b1d9e8 tests: add hexquote_strndup function to libtests
* tests/tests.h (hexquote_strndup): New prototype.
* tests/hexquote_strndup.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-02-04 03:36:25 +00:00
e364920b67 tests: add inode_of_sockfd function to libtests
* tests/tests.h (inode_of_sockfd): New prototype.
* tests/inode_of_sockfd.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-02-02 00:24:48 +00:00
3d54c92691 tests: add error_msg_and_fail function to libtests
* tests/tests.h (error_msg_and_fail): New prototype.
* tests/error_msg.c (error_msg_and_fail): New function.
2016-01-21 23:46:43 +00:00
a5417308e4 tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros
* tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros.
* tests/aio.c (ARRAY_SIZE): Remove.
* tests/mmsg.c (LENGTH_OF): Remove.
2016-01-20 15:24:45 +00:00
590b240444 tests: add hexdump_strdup function to libtests
* tests/tests.h (hexdump_strdup): New prototype.
* tests/hexdump_strdup.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-01-20 15:24:41 +00:00
536a0353dd tests: add tprintf function to libtests
* tests/tests.h (tprintf): New prototype.
* tests/tprintf.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/mmsg.c: Use tprintf.
2016-01-20 15:17:28 +00:00
35eb03fdf7 mmsg.test: check memory access by sendmmsg and recvmmsg decoders
* tests/tests.h (tail_memdup): New prototype.
* tests/tail_alloc.c (tail_memdup): New function.
* tests/mmsg.c (main): Place all objects passed to sendmmsg and recvmmsg
at the end of memory pages followed by inaccessible pages.
2016-01-11 01:05:34 +00:00
87e6b230ff tests: introduce libtests
Introduce tests/libtests.a with common functions for use in tests.

* tests/tests.h: New file.
* tests/error_msg.c: Likewise.
* tests/tail_alloc.c: Likewise.
* tests/get_page_size.c: Likewise.
* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
check_LIBRARIES, LDADD): New variables.
(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
pc_LDADD, times_LDADD): Add $(LDADD).
* tests/.gitignore: Add libtests.a.
2016-01-05 23:17:07 +00:00