diff mbox

[6/5] tests: Remove unused virtTestClearLineRegex

Message ID e7c4522950a367ccec837d5321d7f3174a2d64bd.1455718724.git.crobinso@redhat.com
State Accepted
Commit ad8590905ed7d8f5741857bd7910d2a60ad0e79f
Headers show

Commit Message

Cole Robinson Feb. 17, 2016, 2:19 p.m. UTC
This was only used for test 'xml blanking', which has now all
been removed, and isn't an ideal paradigm anyways since it
inhibits easy XML regeneration.
---
 tests/testutils.c | 45 ---------------------------------------------
 tests/testutils.h |  3 ---
 2 files changed, 48 deletions(-)

-- 
2.5.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/tests/testutils.c b/tests/testutils.c
index c4f1616..c1ca656 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -942,51 +942,6 @@  int virtTestMain(int argc,
 }
 
 
-int virtTestClearLineRegex(const char *pattern,
-                           char *str)
-{
-    regex_t reg;
-    char *lineStart = str;
-    char *lineEnd = strchr(str, '\n');
-
-    if (regcomp(&reg, pattern, REG_EXTENDED | REG_NOSUB) != 0)
-        return -1;
-
-    while (lineStart) {
-        int ret;
-        if (lineEnd)
-            *lineEnd = '\0';
-
-
-        ret = regexec(&reg, lineStart, 0, NULL, 0);
-        //fprintf(stderr, "Match %d '%s' '%s'\n", ret, lineStart, pattern);
-        if (ret == 0) {
-            if (lineEnd) {
-                memmove(lineStart, lineEnd + 1, strlen(lineEnd+1) + 1);
-                /* Don't update lineStart - just iterate again on this
-                   location */
-                lineEnd = strchr(lineStart, '\n');
-            } else {
-                *lineStart = '\0';
-                lineStart = NULL;
-            }
-        } else {
-            if (lineEnd) {
-                *lineEnd = '\n';
-                lineStart = lineEnd + 1;
-                lineEnd = strchr(lineStart, '\n');
-            } else {
-                lineStart = NULL;
-            }
-        }
-    }
-
-    regfree(&reg);
-
-    return 0;
-}
-
-
 /*
  * @cmdset contains a list of command line args, eg
  *
diff --git a/tests/testutils.h b/tests/testutils.h
index df2b2a6..bb58148 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -54,9 +54,6 @@  int virtTestRun(const char *title,
 int virtTestLoadFile(const char *file, char **buf);
 int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen);
 
-int virtTestClearLineRegex(const char *pattern,
-                           char *string);
-
 void virtTestClearCommandPath(char *cmdset);
 
 int virtTestDifference(FILE *stream,