summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2021-06-01 14:21:21 +0200
committerDave Davenport <qball@gmpclient.org>2021-06-01 14:21:21 +0200
commit95c4e0424e126f9be642c909c1931f68c37e4232 (patch)
tree559a00b1c62de0a28dd33551714a0d369210c22c
parent2eefd9b191ee02c78bef11c6fa4575e48e1d372d (diff)
Fix tests.
-rw-r--r--Makefile.am4
-rw-r--r--meson.build4
-rw-r--r--test/helper-config-cmdline-parser.c22
-rw-r--r--test/helper-expand.c22
-rw-r--r--test/helper-pidfile.c21
-rw-r--r--test/helper-test.c22
6 files changed, 95 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 144c4ff5..55713287 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -350,6 +350,7 @@ helper_pidfile_SOURCES=\
include/mode.h\
include/mode-private.h\
source/helper.c\
+ source/theme.c\
source/rofi-types.c\
include/rofi-types.h\
include/helper.h\
@@ -464,6 +465,7 @@ helper_test_SOURCES=\
include/helper-theme.h\
include/xrmoptions.h\
source/xrmoptions.c\
+ source/theme.c\
source/rofi-types.c\
include/rofi-types.h\
test/helper-test.c
@@ -501,6 +503,7 @@ helper_expand_SOURCES=\
include/mode.h\
include/mode-private.h\
source/helper.c\
+ source/theme.c\
include/helper.h\
include/helper-theme.h\
include/xrmoptions.h\
@@ -522,6 +525,7 @@ helper_config_cmdline_parser_SOURCES=\
include/mode.h\
include/mode-private.h\
source/helper.c\
+ source/theme.c\
source/rofi-types.c\
include/rofi-types.h\
include/helper.h\
diff --git a/meson.build b/meson.build
index 4ab0bc71..62e7f780 100644
--- a/meson.build
+++ b/meson.build
@@ -301,6 +301,7 @@ test('helper_pidfile test', executable('helper_pidfile.test', [
],
objects: rofi.extract_objects([
'config/config.c',
+ 'source/theme.c',
'source/helper.c',
'source/xrmoptions.c',
'source/rofi-types.c',
@@ -380,6 +381,7 @@ test('helper test', executable('helper.test', [
],
objects: rofi.extract_objects([
'config/config.c',
+ 'source/theme.c',
'source/helper.c',
'source/xrmoptions.c',
'source/rofi-types.c',
@@ -392,6 +394,7 @@ test('helper_expand test', executable('helper_expand.test', [
],
objects: rofi.extract_objects([
'config/config.c',
+ 'source/theme.c',
'source/helper.c',
'source/xrmoptions.c',
'source/rofi-types.c',
@@ -404,6 +407,7 @@ test('helper_config_cmdline_parser test', executable('helper_config_cmdline_pars
],
objects: rofi.extract_objects([
'config/config.c',
+ 'source/theme.c',
'source/helper.c',
'source/xrmoptions.c',
'source/rofi-types.c',
diff --git a/test/helper-config-cmdline-parser.c b/test/helper-config-cmdline-parser.c
index 3e1ddcb5..14e8e926 100644
--- a/test/helper-config-cmdline-parser.c
+++ b/test/helper-config-cmdline-parser.c
@@ -37,6 +37,7 @@
#include "xcb-internal.h"
#include "rofi.h"
#include "settings.h"
+#include "widgets/textbox.h"
static int test = 0;
@@ -52,6 +53,27 @@ static int test = 0;
abort ( ); \
} \
}
+#include "theme.h"
+ThemeWidget *rofi_theme = NULL;
+
+gboolean rofi_theme_parse_string ( const char *string )
+{
+ return FALSE;
+}
+
+double textbox_get_estimated_char_height ( void )
+{
+ return 12.0;
+}
+void rofi_view_get_current_monitor ( int *width, int *height )
+{
+*width = 1920;
+*height = 1080;
+}
+double textbox_get_estimated_ch ( void )
+{
+ return 9.0;
+}
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
{
}
diff --git a/test/helper-expand.c b/test/helper-expand.c
index 628ffc7e..f589309b 100644
--- a/test/helper-expand.c
+++ b/test/helper-expand.c
@@ -32,11 +32,13 @@
#include <helper.h>
#include <string.h>
#include <xcb/xcb_ewmh.h>
+#include "theme.h"
#include "display.h"
#include "xcb.h"
#include "xcb-internal.h"
#include "rofi.h"
#include "settings.h"
+#include "widgets/textbox.h"
static int test = 0;
@@ -52,6 +54,26 @@ static int test = 0;
abort ( ); \
} \
}
+ThemeWidget *rofi_theme = NULL;
+
+double textbox_get_estimated_char_height ( void )
+{
+ return 12.0;
+}
+void rofi_view_get_current_monitor ( int *width, int *height )
+{
+*width = 1920;
+*height = 1080;
+}
+double textbox_get_estimated_ch ( void )
+{
+ return 9.0;
+}
+gboolean rofi_theme_parse_string ( const char *string )
+{
+return 0;
+}
+
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
{
}
diff --git a/test/helper-pidfile.c b/test/helper-pidfile.c
index e6550a4c..31e42770 100644
--- a/test/helper-pidfile.c
+++ b/test/helper-pidfile.c
@@ -37,6 +37,7 @@
#include "xcb-internal.h"
#include "rofi.h"
#include "settings.h"
+#include "widgets/textbox.h"
static int test = 0;
@@ -44,6 +45,26 @@ static int test = 0;
assert ( a ); \
printf ( "Test %i passed (%s)\n", ++test, # a ); \
}
+#include "theme.h"
+ThemeWidget *rofi_theme = NULL;
+
+gboolean rofi_theme_parse_string ( const char *string )
+{
+ return FALSE;
+}
+double textbox_get_estimated_char_height ( void )
+{
+ return 12.0;
+}
+void rofi_view_get_current_monitor ( int *width, int *height )
+{
+*width = 1920;
+*height = 1080;
+}
+double textbox_get_estimated_ch ( void )
+{
+ return 9.0;
+}
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
{
}
diff --git a/test/helper-test.c b/test/helper-test.c
index e30add0f..2d145dbc 100644
--- a/test/helper-test.c
+++ b/test/helper-test.c
@@ -32,6 +32,7 @@
#include <helper.h>
#include <string.h>
#include <xcb/xcb_ewmh.h>
+#include "theme.h"
#include "display.h"
#include "xcb.h"
#include "xcb-internal.h"
@@ -60,6 +61,27 @@ static int test = 0;
abort ( ); \
} \
}
+
+#include "widgets/textbox.h"
+ThemeWidget *rofi_theme = NULL;
+gboolean rofi_theme_parse_string ( const char *string )
+{
+ return FALSE;
+}
+
+double textbox_get_estimated_char_height ( void )
+{
+ return 12.0;
+}
+void rofi_view_get_current_monitor ( int *width, int *height )
+{
+*width = 1920;
+*height = 1080;
+}
+double textbox_get_estimated_ch ( void )
+{
+ return 9.0;
+}
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
{