]> granicus.if.org Git - graphviz/commitdiff
remove Cgraph test fragments
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 18 Jul 2020 18:17:08 +0000 (11:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 18 Jul 2020 18:17:08 +0000 (11:17 -0700)
Closes #1768.

lib/cgraph/Makefile.am
lib/cgraph/main.c [deleted file]
lib/cgraph/main1.c [deleted file]
lib/cgraph/main2.c [deleted file]
lib/cgraph/main3.c [deleted file]
lib/cgraph/tester.c [deleted file]

index 97ab01550b5d91f518bd6fe1649687da3333f004..be611dbe368832f01fe7f66422d7c074d5b714e2 100644 (file)
@@ -55,7 +55,7 @@ cgraph.3.ps: $(srcdir)/cgraph.3
        @GROFF@ -Tps -man $< >$@
 
 EXTRA_DIST = $(man_MANS) $(pdf_DATA) cmpnd.c \
-       main.c tester.c grammar.c grammar.h scan.c \
+       grammar.c grammar.h scan.c \
        y.tab.c y.tab.h y.output cgraph.vcxproj*
 
 DISTCLEANFILES = $(pdf_DATA) grammar.[ch] scan.c y.output y.tab.[ch] cgraph.3.ps
diff --git a/lib/cgraph/main.c b/lib/cgraph/main.c
deleted file mode 100644 (file)
index 82455b2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/*************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property 
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************/
-
-#include <stdio.h>
-#include <graphviz/cgraph.h>
-
-static void my_ins(Agraph_t * g, Agobj_t * obj, void *context)
-{
-    Agnode_t *n;
-
-    if (AGTYPE(obj) == AGNODE) {
-       n = (Agnode_t *) obj;
-       fprintf(stderr, "%s initialized with label %s\n", agnameof(n),
-               agget(n, "label"));
-    }
-}
-
-static Agcbdisc_t mydisc = { {0, 0, 0}, {my_ins, 0, 0}, {0, 0, 0} };
-
-main(int argc, char **argv)
-{
-    Agraph_t *g, *prev;
-    int dostat;
-
-    if (argc > 1)
-       dostat = atoi(argv[1]);
-    else
-       dostat = 0;
-
-    prev = agopen("some_name", Agdirected, NIL(Agdisc_t *));
-    agcallbacks(prev, FALSE);
-    agpushdisc(prev, &mydisc, NIL(void *));
-    /*agwrite(prev,stdout); */
-    fprintf(stderr, "ready to go, computer fans\n");
-    agcallbacks(prev, TRUE);
-    agclose(prev);
-    return 1;
-}
diff --git a/lib/cgraph/main1.c b/lib/cgraph/main1.c
deleted file mode 100644 (file)
index e444771..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <stdio.h>
-#include <cgraph.h>
-
-int main(int argc, char **argv)
-{
-    Agraph_t *g;
-    Agnode_t   *n;
-       Agsubnode_t *sn;
-    int                sum = 0, i, sum1;
-       int             sz = (argc > 1) ? atoi(argv[1]) : 1;
-       int             run, nruns = (argc > 2) ? atoi(argv[2]) : 1;
-       int             opt = (argc > 3)? atoi(argv[3]) : 0;
-       Agnode_t        *N[sz];
-
-       if (argc == 1) fprintf(stderr,"%s nnodes nruns opt\n\topt = 0 for agfstnode/agnxtnode\n\topt = 1 for dtflatten/dtlink\n\topt = 2 for flat array\n",argv[0]);
-       g = agopen("g",Agdirected,0);
-       for (i = 0; i < sz; i++) {
-       n = agnode(g,0,TRUE);
-               N[i] = n;
-       sum = sum + AGSEQ(n);
-    }
-       switch(opt) {
-       default:
-       case 0:
-               for (run = 0; run < nruns; run++) {
-                       sum1 = 0;
-                       for (n = agfstnode(g); n; n = agnxtnode(g,n)) {
-                               sum1 = sum1 + AGSEQ(n);
-                       }
-                       if (sum != sum1) fprintf(stderr,"error\n");
-               }
-               break;
-       case 1:
-               for (run = 0; run < nruns; run++) {
-                       Dtlink_t *link;
-                       sum1 = 0;
-                       for (link = dtflatten(g->n_seq); link; link = dtlink(g->n_seq,link)) {
-                               sn = (Agsubnode_t*)dtobj(g->n_seq,link);
-                               n = sn->node;
-                               sum1 = sum1 + AGSEQ(n);
-                       }
-                       if (sum != sum1) fprintf(stderr,"error\n");
-               }
-               break;
-       case 2:
-               for (run = 0; run < nruns; run++) {
-                       sum1 = 0;
-                       for (i = 0; i < sz; i++) {
-                               n = N[i];
-                               sum1 = sum1 + AGSEQ(n);
-                       }
-                       if (sum != sum1) fprintf(stderr,"error\n");
-               }
-               break;
-       }
-    return 1;
-}
diff --git a/lib/cgraph/main2.c b/lib/cgraph/main2.c
deleted file mode 100644 (file)
index 82d9611..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <stdio.h>
-#include <cgraph.h>
-#include "bla.h"
-
-int main(int argc, char **argv)
-{
-    Agraph_t *g;
-    Agnode_t   *n, *n0;
-       Agsubnode_t *sn;
-    int                sum = 0, i, sum1;
-       int             sz = (argc > 1) ? atoi(argv[1]) : 1;
-       int             run, nruns = (argc > 2) ? atoi(argv[2]) : 1;
-       int             opt = (argc > 3)? atoi(argv[3]) : 0;
-       Agnode_t        *N[sz];
-
-       if (argc == 1) fprintf(stderr,"%s nnodes nruns opt\n\topt = 0 for agfstnode/agnxtnode\n\topt = 1 for dtflatten/dtlink\n\topt = 2 for flat array\n",argv[0]);
-       g = agopen("g",Agdirected,0);
-       for (i = 0; i < sz; i++) {
-       n = agnode(g,0,TRUE);
-               N[i] = n;
-       sum = sum + AGSEQ(n);
-    }
-       switch(opt) {
-       default:
-       case 0:
-               for (run = 0; run < nruns; run++) {
-                       sum1 = 0;
-                       for (n = agfstnode(g); n; n = agnxtnode(g,n)) {
-                               sum1 = sum1 + AGSEQ(n);
-                       }
-                       if (sum != sum1) fprintf(stderr,"error\n");
-               }
-               break;
-       case 1:
-               for (run = 0; run < nruns; run++) {
-                       Agnoderef_t *nref;
-                       sum1 = 0;
-                       for (nref = FIRSTNREF(g); nref;
-                               nref = NEXTNREF(nref)) {
-                               n = NODEOF(nref);
-                               sum1 = sum1 + AGSEQ(n);
-                               n0 = agnxtnode(g,n);
-                       }
-                       if (sum != sum1) fprintf(stderr,"error %x %x\n", sum, sum1);
-               }
-               break;
-       case 2:
-               for (run = 0; run < nruns; run++) {
-                       sum1 = 0;
-                       for (i = 0; i < sz; i++) {
-                               n = N[i];
-                               sum1 = sum1 + AGSEQ(n);
-                       }
-                       if (sum != sum1) fprintf(stderr,"error\n");
-               }
-               break;
-       }
-    return 1;
-}
diff --git a/lib/cgraph/main3.c b/lib/cgraph/main3.c
deleted file mode 100644 (file)
index f72a2ad..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-#include "cgraph.h"
-
-int main(int argc, char **argv)
-{
-    Agraph_t *g;
-    Agnode_t *u, *v;
-       int rv;
-
-       g = agread(stdin,0);
-       if (argc >= 3) {
-               u = agnode(g,argv[1],FALSE);
-               v = agnode(g,argv[2],FALSE);
-               rv = agnodebefore(u,v);
-               fprintf(stderr,"agnodebefore returns %d\n",rv);
-               fprintf(stderr,"dtsize %d\n",dtsize(g->n_seq));
-       }
-       agwrite(g,stdout);
-}
diff --git a/lib/cgraph/tester.c b/lib/cgraph/tester.c
deleted file mode 100644 (file)
index da6d007..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/*************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property 
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************/
-
-#include <assert.h>
-#include <signal.h>
-#include <stdio.h>
-#include "cgraph.h"
-
-#define NILgraph                       NIL(Agraph_t*)
-#define NILnode                                NIL(Agnode_t*)
-#define NILedge                                NIL(Agedge_t*)
-#define NILsym                         NIL(Agsym_t*)
-#define NILstr                         NIL(char*)
-
-main()
-{
-    Agraph_t *g;
-    Agnode_t *n;
-    Agedge_t *e;
-    Agsym_t *sym;
-    char *val;
-
-    while (g = agread(stdin, NIL(Agdisc_t *))) {
-#ifdef NOTDEF
-       for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-           fprintf(stderr, "%s\n", agnameof(n));
-           for (sym = agnxtattr(g, AGNODE, 0); sym;
-                sym = agnxtattr(g, AGNODE, sym)) {
-               val = agxget(n, sym);
-               fprintf(stderr, "\t%s=%s\n", sym->name, val);
-           }
-       }
-#endif
-       sym = agattr(g, AGRAPH, "nonsense", "junk");
-       fprintf(stderr,"sym = %x, %s\n", sym, sym? sym->defval : "(none)");
-       agwrite(g, stdout);
-    }
-}