[libvirt] [PATCH v1 36/37] Adapt to VIR_ALLOC and virAsprintf in tests/*

Ján Tomko jtomko at redhat.com
Mon Jul 8 10:51:31 UTC 2013


On 07/04/2013 02:06 PM, Michal Privoznik wrote:
> ---
>  tests/commandtest.c              |  8 ++------
>  tests/libvirtdconftest.c         |  4 +---
>  tests/qemumonitortestutils.c     | 17 +++++------------
>  tests/securityselinuxlabeltest.c | 21 +++++----------------
>  tests/securityselinuxtest.c      |  8 +++-----
>  tests/virnetmessagetest.c        | 20 +++++---------------
>  tests/virstoragetest.c           |  5 +----
>  7 files changed, 22 insertions(+), 61 deletions(-)

tests/commandhelper.c:80:    if (VIR_ALLOC_N(newenv, n) < 0)
tests/commandhelper.c-81-        return EXIT_FAILURE;

tests/testutils.c:106:                if (virVasprintf(&str, msg, vargs) == 0) {
tests/testutils.c-107-                    fprintf(stderr, "%s", str);
tests/testutils.c-108-                    VIR_FREE(str);
tests/testutils.c-109-                }


tests/virhashtest.c:21:        if (virAsprintf(&str, __VA_ARGS__) == 0) {
         \
tests/virhashtest.c-22-            fprintf(stderr, "%s", str);
         \
tests/virhashtest.c-23-            VIR_FREE(str);
         \
tests/virhashtest.c-24-        }

These don't need to log an error (and this list isn't exhaustive).

I'm looking forward to v2.

Jan




More information about the libvir-list mailing list