diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-06-02 16:09:20 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-06-02 16:09:20 +0200 |
commit | 48bf1709b6bcc316ad8019afc11d2cf8452817a0 (patch) | |
tree | c3b22e7a006df026f7bfab6411baf08e9898f766 /test | |
parent | eec5c6eadcc5de3c5285a5240db6da2e439d287a (diff) |
Rename HL_ to ROFI_HL_ and fix box test.
Diffstat (limited to 'test')
-rw-r--r-- | test/box-test.c | 24 | ||||
-rw-r--r-- | test/theme-parser-test.c | 26 |
2 files changed, 25 insertions, 25 deletions
diff --git a/test/box-test.c b/test/box-test.c index e76459f9..ba0b3337 100644 --- a/test/box-test.c +++ b/test/box-test.c @@ -32,6 +32,7 @@ #include <assert.h> #include <glib.h> #include <string.h> +#include <theme.h> #include <widgets/box.h> #include <widgets/widget.h> #include <widgets/widget-internal.h> @@ -91,7 +92,7 @@ void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv ) { { - box *b = box_create ( "box", BOX_HORIZONTAL ); + box *b = box_create ( "box", ORIENTATION_HORIZONTAL ); //box_set_padding ( b, 5 ); widget_resize ( WIDGET (b), 100, 20); @@ -153,7 +154,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv ) widget_free ( WIDGET ( b ) ); } { - box *b = box_create ( "box", BOX_VERTICAL ); + box *b = box_create ( "box", ORIENTATION_VERTICAL ); widget_resize ( WIDGET (b), 20, 100); //box_set_padding ( b, 5 ); @@ -187,35 +188,34 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv ) // TODO should this happen automagically? widget_update ( WIDGET ( b ) ) ; TASSERTE ( wid1->w, 20); - TASSERTE ( wid1->h, 48); + TASSERTE ( wid1->h, 38); TASSERTE ( wid2->w, 20); - TASSERTE ( wid2->h, 48); + TASSERTE ( wid2->h, 38); TASSERTE ( wid3->w, 20); - TASSERTE ( wid3->h, 0); + TASSERTE ( wid3->h, 20); widget_resize ( WIDGET (b ), 20, 200 ); TASSERTE ( wid1->w, 20); - TASSERTE ( wid1->h, 98); + TASSERTE ( wid1->h, 88); TASSERTE ( wid2->w, 20); - TASSERTE ( wid2->h, 98); + TASSERTE ( wid2->h, 88); TASSERTE ( wid3->w, 20); - // has no height, gets no height. - TASSERTE ( wid3->h, 0); + TASSERTE ( wid3->h, 20); // TASSERTE ( box_get_fixed_pixels ( b ) , 4 ); widget *wid4 = g_malloc0(sizeof(widget)); widget_enable ( WIDGET ( wid4 ) ); widget_resize ( WIDGET ( wid4 ), 20, 20 ); box_add ( b , WIDGET( wid4 ), FALSE, 5 ); - TASSERTE ( wid4->y, 200); + TASSERTE ( wid4->y, 180); widget *wid5 = g_malloc0(sizeof(widget)); widget_enable ( WIDGET ( wid5 ) ); widget_resize ( WIDGET ( wid5 ), 20, 20 ); box_add ( b , WIDGET( wid5 ), TRUE, 6 ); - TASSERTE ( wid5->y, 136); + TASSERTE ( wid5->y, 149); widget_free ( WIDGET ( b ) ); } { - box *b = box_create ( "box", BOX_VERTICAL ); + box *b = box_create ( "box", ORIENTATION_VERTICAL ); widget_resize ( WIDGET (b), 20, 90); //box_set_padding ( b, 5 ); widget *wid1 = g_malloc0(sizeof(widget)); diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c index 4707f8d3..e2fd9083 100644 --- a/test/theme-parser-test.c +++ b/test/theme-parser-test.c @@ -366,17 +366,17 @@ START_TEST ( test_properties_style) wid.name = "blaat"; wid.state = NULL; rofi_theme_parse_string ( "* { none: none; bold: bold; underline: underline; italic: italic; st: italic strikethrough;}"); - ThemeHighlight th = { HL_BOLD, {0.0,0.0,0.0,0.0}}; + ThemeHighlight th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}}; th = rofi_theme_get_highlight ( &wid, "none", th); - ck_assert_int_eq ( th.style , HL_NONE ); + ck_assert_int_eq ( th.style , ROFI_HL_NONE ); th = rofi_theme_get_highlight ( &wid, "underline", th); - ck_assert_int_eq ( th.style , HL_UNDERLINE); + ck_assert_int_eq ( th.style , ROFI_HL_UNDERLINE); th = rofi_theme_get_highlight ( &wid, "italic", th); - ck_assert_int_eq ( th.style , HL_ITALIC); + ck_assert_int_eq ( th.style , ROFI_HL_ITALIC); th = rofi_theme_get_highlight ( &wid, "bold", th); - ck_assert_int_eq ( th.style , HL_BOLD); + ck_assert_int_eq ( th.style , ROFI_HL_BOLD); th = rofi_theme_get_highlight ( &wid, "st", th); - ck_assert_int_eq ( th.style , HL_ITALIC|HL_STRIKETHROUGH); + ck_assert_int_eq ( th.style , ROFI_HL_ITALIC|ROFI_HL_STRIKETHROUGH); } END_TEST START_TEST ( test_properties_style2 ) @@ -386,15 +386,15 @@ START_TEST ( test_properties_style2 ) wid.state = NULL; rofi_theme_parse_string ( "* { boldu: bold underline ; boldi: bold italic; underlinei: underline italic; italicu: italic underline;}"); - ThemeHighlight th = { HL_BOLD, {0.0,0.0,0.0,0.0}}; + ThemeHighlight th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}}; th = rofi_theme_get_highlight ( &wid, "boldu", th); - ck_assert_int_eq ( th.style , (HL_UNDERLINE|HL_BOLD)); + ck_assert_int_eq ( th.style , (ROFI_HL_UNDERLINE|ROFI_HL_BOLD)); th = rofi_theme_get_highlight ( &wid, "boldi", th); - ck_assert_int_eq ( th.style , (HL_ITALIC|HL_BOLD)); + ck_assert_int_eq ( th.style , (ROFI_HL_ITALIC|ROFI_HL_BOLD)); th = rofi_theme_get_highlight ( &wid, "underlinei", th); - ck_assert_int_eq ( th.style , (HL_ITALIC|HL_UNDERLINE)); + ck_assert_int_eq ( th.style , (ROFI_HL_ITALIC|ROFI_HL_UNDERLINE)); th = rofi_theme_get_highlight ( &wid, "italicu", th); - ck_assert_int_eq ( th.style , (HL_ITALIC|HL_UNDERLINE)); + ck_assert_int_eq ( th.style , (ROFI_HL_ITALIC|ROFI_HL_UNDERLINE)); } END_TEST START_TEST ( test_properties_style_color ) @@ -403,9 +403,9 @@ START_TEST ( test_properties_style_color ) wid.name = "blaat"; wid.state = NULL; rofi_theme_parse_string ( "* { comb: bold #123; }"); - ThemeHighlight th = { HL_BOLD, {0.0,0.0,0.0,0.0}}; + ThemeHighlight th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}}; th = rofi_theme_get_highlight ( &wid, "comb", th); - ck_assert_int_eq ( th.style , (HL_BOLD|HL_COLOR)); + ck_assert_int_eq ( th.style , (ROFI_HL_BOLD|ROFI_HL_COLOR)); ck_assert_double_eq ( th.color.red , (1/15.0)); ck_assert_double_eq ( th.color.green , (2/15.0)); ck_assert_double_eq ( th.color.blue , (3/15.0)); |