Add a test for mimehandler_get_types()
This commit is contained in:
parent
a0dc6a9fe0
commit
69c22237a4
5
tests/applications/Widget.desktop
Normal file
5
tests/applications/Widget.desktop
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=Widget
|
||||||
|
Exec=widget
|
||||||
|
MimeTypes=
|
|
@ -39,6 +39,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
MimeHandler * handler;
|
MimeHandler * handler;
|
||||||
char * path;
|
char * path;
|
||||||
|
String ** types;
|
||||||
|
|
||||||
if((path = getcwd(NULL, 0)) == NULL)
|
if((path = getcwd(NULL, 0)) == NULL)
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -55,6 +56,21 @@ int main(void)
|
||||||
mimehandler_delete(handler);
|
mimehandler_delete(handler);
|
||||||
return 5;
|
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);
|
mimehandler_delete(handler);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ ldflags_force=`pkg-config --libs libSystem gtk+-2.0` $(OBJDIR)../src/libDesktop.
|
||||||
#for Gtk+ 3
|
#for Gtk+ 3
|
||||||
#cflags_force=`pkg-config --cflags libSystem gtk+-3.0`
|
#cflags_force=`pkg-config --cflags libSystem gtk+-3.0`
|
||||||
#ldflags_force=`pkg-config --libs libSystem gtk+-3.0` $(OBJDIR)../src/libDesktop.a
|
#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]
|
[htmllint.log]
|
||||||
type=script
|
type=script
|
||||||
|
@ -18,7 +18,7 @@ depends=htmllint.sh
|
||||||
[mimehandler]
|
[mimehandler]
|
||||||
type=binary
|
type=binary
|
||||||
sources=mimehandler.c
|
sources=mimehandler.c
|
||||||
depends=applications/Root.desktop
|
depends=applications/Root.desktop,applications/Widget.desktop
|
||||||
|
|
||||||
[mimehandler.c]
|
[mimehandler.c]
|
||||||
depends=../src/mimehandler.c
|
depends=../src/mimehandler.c
|
||||||
|
|
Loading…
Reference in New Issue
Block a user