From 7d5f7d3e7dbedf4c00607dd6b81df1a2e4391866 Mon Sep 17 00:00:00 2001 From: alegrand Date: Mon, 20 Mar 2006 15:38:34 +0000 Subject: [PATCH] Adding basic graphxml test git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1963 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- testsuite/Makefile.am | 4 ++++ testsuite/run_tests.in | 1 + testsuite/xbt/graph.xml | 7 +++++++ testsuite/xbt/graphxml_usage.c | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 testsuite/xbt/graph.xml create mode 100644 testsuite/xbt/graphxml_usage.c diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 9d9e2ec55f..405ffd9ce5 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -9,6 +9,7 @@ EXTRA_DIST=run_tests.in \ gras/datadesc.little64\ gras/datadesc.big32 gras/datadesc.big32_8_4 gras/datadesc.big32_2 \ gras/mk_datadesc_structs.pl \ + xbt/graph.xml \ surf/trace_A.txt surf/trace_B.txt surf/trace_A_failure.txt surf/platform.xml # Data sets still to regenerate: @@ -21,6 +22,7 @@ EXTRA_DIST=run_tests.in \ xbt_tests = \ xbt/log_usage \ xbt/heap_bench \ + xbt/graphxml_usage \ xbt/context_usage RL_tests = \ @@ -49,6 +51,8 @@ xbt_log_usage_LDADD= $(LDADD_RL) xbt_heap_bench_LDADD= $(LDADD_RL) +xbt_graphxml_usage_LDADD= $(LDADD_SG) + xbt_context_usage_LDADD= $(LDADD_SG) surf_maxmin_usage_LDADD= $(LDADD_SG) diff --git a/testsuite/run_tests.in b/testsuite/run_tests.in index 53c5458b17..5eb62906b4 100755 --- a/testsuite/run_tests.in +++ b/testsuite/run_tests.in @@ -33,6 +33,7 @@ fi xbt_TESTS=" \ xbt/log_usage@EXEEXT@; \ xbt/context_usage@EXEEXT@; \ + xbt/graphxml_usage@EXEEXT@ @srcdir@/xbt/graph.xml; \ xbt/heap_bench@EXEEXT@;" surf_TESTS="surf/maxmin_usage@EXEEXT@; \ diff --git a/testsuite/xbt/graph.xml b/testsuite/xbt/graph.xml new file mode 100644 index 0000000000..7ed7e712b8 --- /dev/null +++ b/testsuite/xbt/graph.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/testsuite/xbt/graphxml_usage.c b/testsuite/xbt/graphxml_usage.c new file mode 100644 index 0000000000..58efba4e7f --- /dev/null +++ b/testsuite/xbt/graphxml_usage.c @@ -0,0 +1,33 @@ +/* $Id$ */ + +/* A few basic tests for the graphxml library */ + +/* Copyright (c) 2006 Darina Dimitrova, Arnaud Legrand. All rights reserved.*/ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include +#include +#include "xbt/graph.h" +#include "xbt/graphxml.h" + + +void test(char *graph_file); +void test(char *graph_file) +{ + xbt_graph_t graph = xbt_graph_read(graph_file); + xbt_graph_free_graph(graph, NULL, NULL, NULL); +} + +int main(int argc, char** argv) +{ + xbt_init(&argc,argv); + if(argc==1) { + fprintf(stderr,"Usage : %s graph.xml\n",argv[0]); + return 1; + } + test(argv[1]); + + return 0; +} -- 2.20.1