diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-04-25 23:34:48 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-04-25 23:34:48 +0200 |
commit | 470057be17347568db8bd51f3a714431596f23aa (patch) | |
tree | 868403564905208b792c757daea3adbe22519941 | |
parent | f933fc4ae0f397fa2be7163235e9c73e36d4bdc6 (diff) |
Add some tests importing (and failing) file.
-rw-r--r-- | test/theme-parser-test.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c index 7f5c0bf6..f97545e5 100644 --- a/test/theme-parser-test.c +++ b/test/theme-parser-test.c @@ -56,7 +56,7 @@ struct xcb_stuff *xcb; gboolean error = FALSE; void rofi_add_error_message ( GString *msg ) { - + fprintf ( stdout, "%s\n", msg->str ); error = TRUE; g_string_free ( msg, TRUE ); } @@ -175,6 +175,7 @@ int main ( int argc, char ** argv ) } { + rofi_theme = NULL; error = 0; rofi_theme_parse_string ( "* { test: 10px;}"); TASSERT ( error == 0 ); @@ -188,6 +189,7 @@ int main ( int argc, char ** argv ) rofi_theme = NULL; } { + rofi_theme = NULL; error = 0; rofi_theme_parse_string ( "* { test: 10%;}"); TASSERT ( error == 0 ); @@ -200,4 +202,28 @@ int main ( int argc, char ** argv ) rofi_theme_free ( rofi_theme ); rofi_theme = NULL; } + + { + rofi_theme = NULL; + rofi_theme_parse_file ("/dev/null"); + TASSERT ( error == 0 ); + TASSERT ( rofi_theme != NULL ); + rofi_theme_free ( rofi_theme ); + } + { + rofi_theme = NULL; + rofi_theme_parse_file ("not-existing-file.rasi"); + TASSERT ( error == TRUE ); + TASSERT ( rofi_theme == NULL ); + error = 0; + } + { + rofi_theme = NULL; + rofi_theme_parse_string ( "@import \"/dev/null\"" ); + TASSERT ( error == 0 ); + TASSERT ( rofi_theme != NULL ); + rofi_theme_free ( rofi_theme ); + + + } } |