Add a test for mimehandler_get_types()

This commit is contained in:
Pierre Pronchery 2017-12-07 19:00:30 +01:00
parent a0dc6a9fe0
commit 69c22237a4
3 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,5 @@
[Desktop Entry]
Type=Application
Name=Widget
Exec=widget
MimeTypes=

View File

@ -39,6 +39,7 @@ int main(void)
{
MimeHandler * handler;
char * path;
String ** types;
if((path = getcwd(NULL, 0)) == NULL)
return 2;
@ -55,6 +56,21 @@ int main(void)
mimehandler_delete(handler);
return 5;
}
if(mimehandler_get_types(handler) != NULL)
{
mimehandler_delete(handler);
return 6;
}
mimehandler_delete(handler);
if((handler = mimehandler_new_load("Widget")) == NULL)
return 7;
if((types = mimehandler_get_types(handler)) == NULL
|| types[0] != NULL)
{
mimehandler_delete(handler);
return 8;
}
free(types);
mimehandler_delete(handler);
return 0;
}

View File

@ -8,7 +8,7 @@ ldflags_force=`pkg-config --libs libSystem gtk+-2.0` $(OBJDIR)../src/libDesktop.
#for Gtk+ 3
#cflags_force=`pkg-config --cflags libSystem gtk+-3.0`
#ldflags_force=`pkg-config --libs libSystem gtk+-3.0` $(OBJDIR)../src/libDesktop.a
dist=Makefile,applications/Root.desktop,htmllint.sh,pkgconfig.sh,tests.sh,xmllint.sh
dist=Makefile,applications/Root.desktop,applications/Widget.desktop,htmllint.sh,pkgconfig.sh,tests.sh,xmllint.sh
[htmllint.log]
type=script
@ -18,7 +18,7 @@ depends=htmllint.sh
[mimehandler]
type=binary
sources=mimehandler.c
depends=applications/Root.desktop
depends=applications/Root.desktop,applications/Widget.desktop
[mimehandler.c]
depends=../src/mimehandler.c