Fix tests.

This commit is contained in:
Dave Davenport 2021-06-01 14:21:21 +02:00
parent 2eefd9b191
commit 95c4e0424e
6 changed files with 95 additions and 0 deletions

View File

@ -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\

View File

@ -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',

View File

@ -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 )
{
}

View File

@ -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 )
{
}

View File

@ -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 )
{
}

View File

@ -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 )
{