]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Remove unused virtTestClearLineRegex
authorCole Robinson <crobinso@redhat.com>
Wed, 17 Feb 2016 14:10:28 +0000 (09:10 -0500)
committerCole Robinson <crobinso@redhat.com>
Wed, 17 Feb 2016 16:07:21 +0000 (11:07 -0500)
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
tests/testutils.h

index c4f16165ac3ea3b99c3fcab9aaf864b50271f3e7..c1ca6568fa944d4bd781954a1b31216940c2e68b 100644 (file)
@@ -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
  *
index df2b2a6667641525858e0a1203b255c32041cf11..bb58148453664ccbca88c7c84e1cd8d1ff2f0704 100644 (file)
@@ -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,