mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: Remove unused virtTestClearLineRegex
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.
This commit is contained in:
@@ -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(®, pattern, REG_EXTENDED | REG_NOSUB) != 0)
|
||||
return -1;
|
||||
|
||||
while (lineStart) {
|
||||
int ret;
|
||||
if (lineEnd)
|
||||
*lineEnd = '\0';
|
||||
|
||||
|
||||
ret = regexec(®, 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(®);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @cmdset contains a list of command line args, eg
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user