From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 9707CB4D1 for ; Fri, 13 Feb 2015 16:03:24 +0100 (CET) Received: by mail-wg0-f51.google.com with SMTP id y19so17171156wgg.10 for ; Fri, 13 Feb 2015 07:03:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+PFPlDVpDjT9JRzxEonVEYd+cLtHGMj4cpoXq2w+uWQ=; b=dJxpu4OcEYWodhbkn7zaCmPiW0pfP8DsbI+hRQ84o5kg2ZvzaEPVKZR9o4bpaOcepC 1+QrzjNFQ49nn7wrnOvoRl3hpzluQzGonojcSBDyehri1q5fB4Jlsgoz36AFFzcizuRi PJDdxT41pb6KePpq4nE8rE8ta2prcbPQ6riPh6SJnzIOLVkslJTr00HL82Yor3bzTFW+ wAdc5WnkjXj2DDJXgv4toruk3LBr0LvaxSCdvTLjbjEZIYYewhcKOMc+ljSLP57Df912 WVMXn1m4vSvWVewvoMMthyP1hxAWM2bRkZe/1/rZ1hJ2i8l5p+WJdJJ6AvjyeTMeN7C4 MusA== X-Gm-Message-State: ALoCoQnhPNWLxsgZIsXfkPNIjPoicoxhJC+cSfNvNWgaLr0j8em0qNBgvJmXiH8Zm760A+AKUOiB X-Received: by 10.194.118.198 with SMTP id ko6mr18766472wjb.47.1423839804321; Fri, 13 Feb 2015 07:03:24 -0800 (PST) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id e18sm10413605wjz.27.2015.02.13.07.03.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 07:03:23 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 13 Feb 2015 16:03:15 +0100 Message-Id: <1423839795-29450-4-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423839795-29450-1-git-send-email-david.marchand@6wind.com> References: <1420635809-30976-1-git-send-email-david.marchand@6wind.com> <1423839795-29450-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 3/3] app/test: fix devargs tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 15:03:25 -0000 Add missing free for devargs->args and fix tests. Signed-off-by: David Marchand --- app/test/test_devargs.c | 6 ++++-- app/test/test_pci.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index 3d9f7bc..08fb781 100644 --- a/app/test/test_devargs.c +++ b/app/test/test_devargs.c @@ -48,6 +48,8 @@ static void free_devargs_list(void) while (!TAILQ_EMPTY(&devargs_list)) { devargs = TAILQ_FIRST(&devargs_list); TAILQ_REMOVE(&devargs_list, devargs, next); + if (devargs->args) + free(devargs->args); free(devargs); } } @@ -92,7 +94,7 @@ test_devargs(void) if (strncmp(devargs->virtual.drv_name, "eth_ring1", sizeof(devargs->virtual.drv_name)) != 0) goto fail; - if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args)) != 0) + if (!devargs->args || strcmp(devargs->args, "k1=val,k2=val2") != 0) goto fail; free_devargs_list(); @@ -105,7 +107,7 @@ test_devargs(void) devargs->pci.addr.devid != 0 || devargs->pci.addr.function != 1) goto fail; - if (strncmp(devargs->args, "", sizeof(devargs->args)) != 0) + if (devargs->args) goto fail; free_devargs_list(); diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 747d8b7..5530d99 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -139,6 +139,8 @@ static void free_devargs_list(void) while (!TAILQ_EMPTY(&devargs_list)) { devargs = TAILQ_FIRST(&devargs_list); TAILQ_REMOVE(&devargs_list, devargs, next); + if (devargs->args) + free(devargs->args); free(devargs); } } -- 1.7.10.4