From e9f1786847cf34542c5735dcc9f74835a144341e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 26 Mar 2022 13:08:17 -0700 Subject: [PATCH] tests: remove unused cdiff.c --- ci/clang_format.py | 1 - rtest/cdiff.c | 99 ---------------------------------------------- 2 files changed, 100 deletions(-) delete mode 100644 rtest/cdiff.c diff --git a/ci/clang_format.py b/ci/clang_format.py index 7201ea2fd..a42aa1e0f 100644 --- a/ci/clang_format.py +++ b/ci/clang_format.py @@ -841,7 +841,6 @@ EXCLUDE = ( "plugin/webp/gvplugin_webp.c", "plugin/xlib/gvdevice_xlib.c", "plugin/xlib/gvplugin_xlib.c", - "rtest/cdiff.c", "rtest/check-package-version.c", "tclpkg/gdtclft/gdtclft.c", "tclpkg/gv/gv.cpp", diff --git a/rtest/cdiff.c b/rtest/cdiff.c deleted file mode 100644 index 9743e5edf..000000000 --- a/rtest/cdiff.c +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************* - * 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 -#include -#include -#include -#include -#include -#include -#include - -#include - -static int openF(char *fname) -{ - int fd = open(fname, O_RDONLY); - - if (fd < 0) { - fprintf(stderr, "Could not open %s for reading: %s\n\n", fname, - strerror(errno)); - graphviz_exit(1); - } - return fd; -} - -static int fileSize(int fd) -{ - struct stat sb; - - fstat(fd, &sb); - return sb.st_size; -} - -main(int argc, char *argv[]) -{ - char *p1; - char *p2; - int i, count; - int f1, f2; - int l1, l2; - int n1, n2, n; - int xval, base, len; - char buf1[BUFSIZ]; - char buf2[BUFSIZ]; - - if (argc != 3) { - fprintf(stderr, "Usage: %s \n", argv[0]); - graphviz_exit(1); - } - - f1 = openF(argv[1]); - f2 = openF(argv[2]); - - l1 = fileSize(f1); - l2 = fileSize(f2); - if (l1 < l2) { - len = l1; - base = l2; - count = l2 - l1; - } else { - len = l2; - base = l1; - count = l1 - l2; - } - - i = 0; - while (i < len) { - n1 = read(f1, buf1, BUFSIZ); - n2 = read(f2, buf2, BUFSIZ); - if (n1 < n2) - n = i + n1; - else - n = i + n2; - p1 = buf1; - p2 = buf2; - while (i < n) { - if (*p1++ != *p2++) - count++; - i++; - } - } - - if (count) { - printf("%d/%d(%f)\n", count, base, ((double) count) / base); - xval = 2; - } else - xval = 0; - - graphviz_exit(xval); - -} -- 2.40.0