diff --git a/tests/.gitignore b/tests/.gitignore index 75fafd0..a78da40 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -9,6 +9,7 @@ fsendfile lfile makepath pidfile +printhdr progress rsync str diff --git a/tests/Makefile.am b/tests/Makefile.am index 326a0e6..2f7f3e2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ TESTS += fsendfile TESTS += lfile TESTS += makepath TESTS += pidfile +TESTS += printhdr TESTS += progress TESTS += rsync TESTS += str diff --git a/tests/printhdr.c b/tests/printhdr.c new file mode 100644 index 0000000..6b7eb47 --- /dev/null +++ b/tests/printhdr.c @@ -0,0 +1,20 @@ +#include /* atexit() */ +#include /* usleep() */ + +#include "check.h" + +#define SCREEN_WIDTH 80 + +int main(void) +{ + FILE *fp = stderr; + char buf[SCREEN_WIDTH]; + + printhdr(fp, "", 0, UNDERSCORE); + printhdr(fp, "Neighbor Table", 0, 0); + snprintf(buf, sizeof(buf), "%-15s %-15s %7s %-5s%10s %6s", + "Neighbor", "Interface", "Version", "Flags", "Uptime", "Expire"); + printhdr(fp, buf, 0, REVERSE); + + return 0; +}