From patchwork Wed Feb 17 14:19:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 62113 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp28296lbl; Wed, 17 Feb 2016 06:22:10 -0800 (PST) X-Received: by 10.194.185.199 with SMTP id fe7mr2250605wjc.50.1455718930081; Wed, 17 Feb 2016 06:22:10 -0800 (PST) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id y133si4768441wme.72.2016.02.17.06.22.09 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 17 Feb 2016 06:22:10 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1HEJDwI029393; Wed, 17 Feb 2016 09:19:13 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1HEJCdm027358 for ; Wed, 17 Feb 2016 09:19:12 -0500 Received: from colepc.redhat.com (ovpn-113-23.phx2.redhat.com [10.3.113.23]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1HEJBsB026709; Wed, 17 Feb 2016 09:19:11 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 17 Feb 2016 09:19:08 -0500 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/5] tests: Remove unused virtTestClearLineRegex X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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 --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(®, 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 * 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,