~ubuntu-branches/ubuntu/karmic/mergeant/karmic

« back to all changes in this revision

Viewing changes to testing/mg-test-grapher.c

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo R. Montesino
  • Date: 2007-11-29 08:44:48 UTC
  • mfrom: (2.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20071129084448-6aon73d22bv6hzfw
Tags: 0.67-3
* Re-enable installation of the mime files in mergeant.install
* mergeant.dirs: create usr/share/mime/packages to make dh_installmime add
  the update-mime-database code snippets

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "../libmergeant/libmergeant.h"
2
 
#include "mg-test-common.h"
3
 
 
4
 
gint main (int argc, char **argv) {
5
 
        MgConf *conf;
6
 
        GError *error = NULL;
7
 
        MgGraphviz *graph;
8
 
        GSList *list, *tmplist;
9
 
 
10
 
        gtk_init (&argc, &argv);
11
 
 
12
 
        conf = MG_CONF (mg_conf_new ());
13
 
        g_print ("############################ GRAPHER ###############################\n"); 
14
 
        g_print ("# Loading DATA_GRAPH.xml                                           #\n");
15
 
 
16
 
 
17
 
        if (!mg_conf_load_xml_file (conf, "DATA_GRAPH.xml", &error)) {
18
 
                g_print ("Error occurred:\n\t%s\n", error->message);
19
 
                g_error_free (error);
20
 
                error = NULL;
21
 
                exit (1);
22
 
        }
23
 
 
24
 
        graph = MG_GRAPHVIZ (mg_graphviz_new (conf));
25
 
        list = mg_conf_get_queries (conf);
26
 
        tmplist = list;
27
 
        while (list) {
28
 
                mg_graphviz_add_to_graph (graph, list->data);
29
 
                list = g_slist_next (list);
30
 
        }
31
 
        g_slist_free (tmplist);
32
 
        g_print ("# Saving DATA_GRAPH.dot                                            #\n");
33
 
        if (!mg_graphviz_save_file (graph, "DATA_GRAPH.dot", &error)) {
34
 
                g_print ("Error occurred:\n\t%s\n", error->message);
35
 
                g_error_free (error);
36
 
                error = NULL;
37
 
                exit (1);
38
 
        }
39
 
        g_print ("####################################################################\n"); 
40
 
        g_object_unref (G_OBJECT (graph));
41
 
        g_object_unref (G_OBJECT (conf));
42
 
 
43
 
        return 0;
44
 
}