summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-07 20:03:21 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-07 20:03:21 +0200
commit28ca3cb5108a73b47c05ffd46bf1da7bf0e966fe (patch)
treee276da6820c56a1ca95fe8d2a69fa0366c6dac31 /test
parentacfc07a63e056bff1338a3430acc3ea93bd9ecc6 (diff)
Fix tests.
Diffstat (limited to 'test')
-rw-r--r--test/box-test.c13
-rw-r--r--test/theme-parser-test.c6
2 files changed, 16 insertions, 3 deletions
diff --git a/test/box-test.c b/test/box-test.c
index 134ed521..57d8f903 100644
--- a/test/box-test.c
+++ b/test/box-test.c
@@ -103,6 +103,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
widget_resize ( WIDGET (b), 100, 20);
widget *wid1 = g_malloc0(sizeof(widget));
+ wid1->parent = WIDGET(b);
box_add ( b , WIDGET( wid1 ), TRUE );
// Widget not enabled. no width allocated.
TASSERTE ( wid1->h, 0);
@@ -113,6 +114,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERTE ( wid1->h, 20);
TASSERTE ( wid1->w, 100 );
widget *wid2 = g_malloc0(sizeof(widget));
+ wid2->parent = WIDGET (b) ;
widget_enable ( WIDGET ( wid2 ) );
box_add ( b , WIDGET( wid2 ), TRUE );
TASSERTE ( wid1->h, 20);
@@ -121,6 +123,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERTE ( wid2->w, 49);
widget *wid3 = g_malloc0(sizeof(widget));
+ wid3->parent = WIDGET (b);
widget_enable ( WIDGET ( wid3 ) );
box_add ( b , WIDGET( wid3 ), FALSE );
TASSERTE ( wid1->h, 20);
@@ -148,11 +151,13 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
// TASSERTE ( box_get_fixed_pixels ( b ) , 24 );
widget *wid4 = g_malloc0(sizeof(widget));
+ wid4->parent = WIDGET ( b );
widget_enable ( WIDGET ( wid4 ) );
widget_resize ( WIDGET ( wid4 ), 20, 20 );
box_add ( b , WIDGET( wid4 ), FALSE );
TASSERTE ( wid4->x, 200-20);
widget *wid5 = g_malloc0(sizeof(widget));
+ wid5->parent = WIDGET ( b );
widget_enable ( WIDGET ( wid5 ) );
widget_resize ( WIDGET ( wid5 ), 20, 20 );
box_add ( b , WIDGET( wid5 ), TRUE );
@@ -165,6 +170,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
//box_set_padding ( b, 5 );
widget *wid1 = g_malloc0(sizeof(widget));
+ wid1->parent = WIDGET ( b );
box_add ( b , WIDGET( wid1 ), TRUE );
// Widget not enabled. no width allocated.
TASSERTE ( wid1->h, 0);
@@ -175,6 +181,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERTE ( wid1->h, 100);
TASSERTE ( wid1->w, 20 );
widget *wid2 = g_malloc0(sizeof(widget));
+ wid2->parent = WIDGET ( b );
widget_enable ( WIDGET ( wid2 ) );
box_add ( b , WIDGET( wid2 ), TRUE );
TASSERTE ( wid1->w, 20);
@@ -183,6 +190,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERTE ( wid2->h, 49);
widget *wid3 = g_malloc0(sizeof(widget));
+ wid3->parent = WIDGET ( b );
widget_enable ( WIDGET ( wid3 ) );
box_add ( b , WIDGET( wid3 ), FALSE );
TASSERTE ( wid1->w, 20);
@@ -209,11 +217,13 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERTE ( wid3->h, 20);
// TASSERTE ( box_get_fixed_pixels ( b ) , 4 );
widget *wid4 = g_malloc0(sizeof(widget));
+ wid4->parent = WIDGET ( b );
widget_enable ( WIDGET ( wid4 ) );
widget_resize ( WIDGET ( wid4 ), 20, 20 );
box_add ( b , WIDGET( wid4 ), FALSE );
TASSERTE ( wid4->y, 180);
widget *wid5 = g_malloc0(sizeof(widget));
+ wid5->parent = WIDGET ( b );
widget_enable ( WIDGET ( wid5 ) );
widget_resize ( WIDGET ( wid5 ), 20, 20 );
box_add ( b , WIDGET( wid5 ), TRUE );
@@ -225,14 +235,17 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
widget_resize ( WIDGET (b), 20, 90);
//box_set_padding ( b, 5 );
widget *wid1 = g_malloc0(sizeof(widget));
+ wid1->parent = WIDGET ( b );
wid1->type = 1;
widget_enable(wid1);
box_add ( b , WIDGET( wid1 ), TRUE );
widget *wid2 = g_malloc0(sizeof(widget));
+ wid2->parent = WIDGET ( b );
wid2->type = 1;
widget_enable(wid2);
box_add ( b , WIDGET( wid2 ), TRUE );
widget *wid3 = g_malloc0(sizeof(widget));
+ wid3->parent = WIDGET ( b );
wid3->type = 2;
widget_enable(wid3);
box_add ( b , WIDGET( wid3 ), TRUE );
diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c
index 53b15b9c..b9831619 100644
--- a/test/theme-parser-test.c
+++ b/test/theme-parser-test.c
@@ -927,7 +927,7 @@ START_TEST ( test_properties_color_names )
char * str = g_strdup_printf("* { color: %s;}", CSSColors[iter].name);
rofi_theme_parse_string(str);
ThemeWidget *twid = rofi_theme_find_widget ( wid.name, wid.state, FALSE );
- Property *p = rofi_theme_find_property ( twid, P_COLOR, "color", FALSE );
+ Property *p = rofi_theme_find_property ( twid, P_COLOR, "text-color", FALSE );
ck_assert_ptr_nonnull ( p );
ck_assert_double_eq ( p->value.color.alpha , 1.0 );
ck_assert_double_eq_tol ( p->value.color.red , CSSColors[iter].r/255.0, 0.004);
@@ -939,7 +939,7 @@ START_TEST ( test_properties_color_names )
{
rofi_theme_parse_string("* {color: transparent;}");
ThemeWidget *twid = rofi_theme_find_widget ( wid.name, wid.state, FALSE );
- Property *p = rofi_theme_find_property ( twid, P_COLOR, "color", FALSE );
+ Property *p = rofi_theme_find_property ( twid, P_COLOR, "text-color", FALSE );
ck_assert_ptr_nonnull ( p );
ck_assert_double_eq ( p->value.color.alpha , 0.0 );
ck_assert_double_eq_tol ( p->value.color.red , 0.0, 0.004);
@@ -957,7 +957,7 @@ START_TEST ( test_properties_color_names_alpha )
char * str = g_strdup_printf("* { color: %s / %d %%;}", CSSColors[iter].name, iter%101);
rofi_theme_parse_string(str);
ThemeWidget *twid = rofi_theme_find_widget ( wid.name, wid.state, FALSE );
- Property *p = rofi_theme_find_property ( twid, P_COLOR, "color", FALSE );
+ Property *p = rofi_theme_find_property ( twid, P_COLOR, "text-color", FALSE );
ck_assert_ptr_nonnull ( p );
ck_assert_double_eq ( p->value.color.alpha , (iter%101)/100.0);
ck_assert_double_eq_tol ( p->value.color.red , CSSColors[iter].r/255.0, 0.004);