summaryrefslogtreecommitdiff
path: root/test/bmMenuNew.c
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2014-08-21 01:47:30 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2014-08-21 01:47:30 +0300
commitf1bb87a808ff1383a2d27dc2c4a1f8812c470c31 (patch)
tree6669801544e51621c9269e5e89d3ae7a83c73ba8 /test/bmMenuNew.c
parent5bd81e8d384e82926a7671527e62aebafed1183f (diff)
parent536eee6d0bf8eb99b6566f7f4fd646b3cd76f532 (diff)
downloadbemenu-f1bb87a808ff1383a2d27dc2c4a1f8812c470c31.tar.gz
bemenu-f1bb87a808ff1383a2d27dc2c4a1f8812c470c31.tar.bz2
bemenu-f1bb87a808ff1383a2d27dc2c4a1f8812c470c31.zip
Merge branch 'develop'
Diffstat (limited to 'test/bmMenuNew.c')
-rw-r--r--test/bmMenuNew.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/bmMenuNew.c b/test/bmMenuNew.c
new file mode 100644
index 0000000..ebab314
--- /dev/null
+++ b/test/bmMenuNew.c
@@ -0,0 +1,29 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <assert.h>
+#include <bemenu.h>
+
+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);
+ assert(menu);
+ bmMenuRender(menu);
+ bmMenuFree(menu);
+ }
+ }
+
+ return EXIT_SUCCESS;
+}
+
+/* vim: set ts=8 sw=4 tw=0 :*/