Add test case for stylehint size bug
[projects/chimara/chimara.git] / tests / test-userstyle.c
diff --git a/tests/test-userstyle.c b/tests/test-userstyle.c
new file mode 100644 (file)
index 0000000..c3a32c4
--- /dev/null
@@ -0,0 +1,25 @@
+#include <libchimara/glk.h>
+
+winid_t mainwin;
+
+void 
+glk_main(void)
+{
+       /* Create user style before creating windows */
+       glk_stylehint_set(wintype_AllTypes, style_User1, stylehint_Size, -1);
+       glk_stylehint_set(wintype_AllTypes, style_User2, stylehint_Size, 0);
+       
+       mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+       if(!mainwin)
+               return;
+       glk_set_window(mainwin);
+
+       glk_set_style(style_User1);
+       glk_put_string("This text is in User1 and slightly smaller");
+       glk_set_style(style_Normal);
+       glk_put_string(".\n");
+       glk_set_style(style_User2);
+       glk_put_string("This test is in User2 at normal size");
+       glk_set_style(style_Normal);
+       glk_put_string(".\n");
+}