[maemo-commits] [maemo-commits] r10955 - in projects/haf/trunk/libhildonmime: . libhildonmime tests

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Apr 4 13:10:12 EEST 2007
Author: richard
Date: 2007-04-04 13:10:10 +0300 (Wed, 04 Apr 2007)
New Revision: 10955

Removed:
   projects/haf/trunk/libhildonmime/libhildonmime/test-mime-default-app.c
Modified:
   projects/haf/trunk/libhildonmime/ChangeLog
   projects/haf/trunk/libhildonmime/libhildonmime/hildon-mime-categories.c
   projects/haf/trunk/libhildonmime/tests/test-mime-category.c
   projects/haf/trunk/libhildonmime/tests/test-mime-patterns.c
Log:
Cleanup

Modified: projects/haf/trunk/libhildonmime/ChangeLog
===================================================================
--- projects/haf/trunk/libhildonmime/ChangeLog	2007-04-04 09:53:23 UTC (rev 10954)
+++ projects/haf/trunk/libhildonmime/ChangeLog	2007-04-04 10:10:10 UTC (rev 10955)
@@ -1,3 +1,12 @@
+2007-04-04  Richard Hult  <richard at imendio.com>
+
+	* tests/test-mime-category.c: Improve output.
+
+	* Remove libhildonmime/test-mime-default-app.c, it was moved to
+	tests/.
+
+	* tests/test-mime-patterns.c: Say if/when the tests passed.
+
 2007-03-26  Richard Hult  <richard at imendio.com>
 
 	* Release 1.9.3.

Modified: projects/haf/trunk/libhildonmime/libhildonmime/hildon-mime-categories.c
===================================================================
--- projects/haf/trunk/libhildonmime/libhildonmime/hildon-mime-categories.c	2007-04-04 09:53:23 UTC (rev 10954)
+++ projects/haf/trunk/libhildonmime/libhildonmime/hildon-mime-categories.c	2007-04-04 10:10:10 UTC (rev 10955)
@@ -453,6 +453,8 @@
 static void
 xdg_mime_shutdown (void)
 {
+	g_print ("*** shutdown\n");
+	
 	/* FIXME: Need to make this (and the whole library) thread safe */
 	if (dir_time_list) {
 		xdg_dir_time_list_free (dir_time_list);

Deleted: projects/haf/trunk/libhildonmime/libhildonmime/test-mime-default-app.c
===================================================================
--- projects/haf/trunk/libhildonmime/libhildonmime/test-mime-default-app.c	2007-04-04 09:53:23 UTC (rev 10954)
+++ projects/haf/trunk/libhildonmime/libhildonmime/test-mime-default-app.c	2007-04-04 10:10:10 UTC (rev 10955)
@@ -1,66 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2006 Nokia Corporation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; version 2 of the
- * License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* Test file to test the GnomeVFS default app. */
-
-#include <config.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-
-int 
-main (int argc, char **argv)
-{
-	GnomeVFSMimeApplication *mime_application;
-
-	gnome_vfs_init ();
-
-	if (argc < 2) {
-		g_printerr ("Usage: %s <mime-type>\n", argv[0]);
-		return EXIT_FAILURE;
-	}
-
-	if (!strchr (argv[1], '/')) {
-		g_printerr ("Mime type must be in the form:'image/png'\n");
-		return EXIT_FAILURE;
-	}
-
-	mime_application = gnome_vfs_mime_get_default_application (argv[1]);
-	if (!mime_application) {
-		g_printerr ("No mime details associated with:'%s'\n", argv[1]);
-		return EXIT_FAILURE;
-	}
-		
-	g_print ("Mime details for:'%s'\n", argv[1]);
-	g_print ("\tid:'%s'\n", mime_application->id);
-	g_print ("\tname:'%s'\n", mime_application->name);
-	g_print ("\tcommand:'%s'\n", mime_application->command);
-	
-	gnome_vfs_mime_application_free (mime_application);
-
-	gnome_vfs_shutdown ();
-
-	return EXIT_SUCCESS;
-}
-
-

Modified: projects/haf/trunk/libhildonmime/tests/test-mime-category.c
===================================================================
--- projects/haf/trunk/libhildonmime/tests/test-mime-category.c	2007-04-04 09:53:23 UTC (rev 10954)
+++ projects/haf/trunk/libhildonmime/tests/test-mime-category.c	2007-04-04 10:10:10 UTC (rev 10955)
@@ -29,8 +29,9 @@
 int
 main (int argc, char **argv)
 {
-	gchar            *name;
+	gchar              *name;
 	HildonMimeCategory  category;
+	const gchar        *str;
 
 	gnome_vfs_init ();
 
@@ -42,8 +43,12 @@
 	name = argv[1];
 	category = hildon_mime_get_category_for_mime_type (name);
 
-	g_print ("category is: %s (%d)\n",
-		 hildon_mime_get_category_name (category), category);
+	str = hildon_mime_get_category_name (category);
+	if (!str) {
+		g_print ("No category found\n");
+	} else {
+		g_print ("The category is '%s' (%d)\n", str, category);
+	}
 
 	return 0;
 }

Modified: projects/haf/trunk/libhildonmime/tests/test-mime-patterns.c
===================================================================
--- projects/haf/trunk/libhildonmime/tests/test-mime-patterns.c	2007-04-04 09:53:23 UTC (rev 10954)
+++ projects/haf/trunk/libhildonmime/tests/test-mime-patterns.c	2007-04-04 10:10:10 UTC (rev 10955)
@@ -133,5 +133,7 @@
 		return 1;
 	}
 
+	g_print ("All tests passed\n");
+	
 	return 0;
 }


More information about the maemo-commits mailing list