bemenu/test/bmMenuNew.c

30 lines
715 B
C
Raw Normal View History

2014-03-28 20:00:23 +00:00
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
2014-03-28 20:00:23 +00:00
#include <assert.h>
#include <bemenu.h>
2014-03-28 20:00:23 +00:00
int main(int argc, char **argv)
{
(void)argc, (void)argv;
// TEST: Instance bmMenu with all possible draw modes.
{
bmDrawMode i;
for (i = 0; i < BM_DRAW_MODE_LAST; ++i) {
if (i == BM_DRAW_MODE_CURSES && !isatty(STDIN_FILENO)) {
printf("Skipping test for mode BM_DRAW_MODE_CURSES, as not running on terminal.\n");
continue;
}
bmMenu *menu = bmMenuNew(i);
2014-04-09 22:41:32 +00:00
assert(menu);
2014-03-28 20:00:23 +00:00
bmMenuRender(menu);
bmMenuFree(menu);
}
}
return EXIT_SUCCESS;
}
/* vim: set ts=8 sw=4 tw=0 :*/