From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 09/11] eal/pci: replace SYSFS_PCI_DEVICES with pci_get_sysfs_path() Date: Thu, 12 May 2016 17:41:22 +0200 Message-ID: <9394515.aZP2i1zDQW@xps13> References: <1462904011-29838-1-git-send-email-viktorin@rehivetech.com> <1462904011-29838-10-git-send-email-viktorin@rehivetech.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, David Marchand , Bruce Richardson To: Jan Viktorin Return-path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 6A3107E93 for ; Thu, 12 May 2016 17:41:24 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id a17so143148937wme.0 for ; Thu, 12 May 2016 08:41:24 -0700 (PDT) In-Reply-To: <1462904011-29838-10-git-send-email-viktorin@rehivetech.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-05-10 20:13, Jan Viktorin: > The SYSFS_PCI_DEVICES is a constant that makes the PCI testing difficult as > it points to an absolute path. We remove using this constant and introducing > a function pci_get_sysfs_path that gives the same value. However, the user can > pass a SYSFS_PCI_DEVICES env variable to override the path. It is now possible > to create a fake sysfs hierarchy for testing. Yeah! > + orig = pci_get_sysfs_path(); > + ret = setenv("SYSFS_PCI_DEVICES", "My Documents", 1); Oh no! > + TEST_ASSERT_SUCCESS(ret, "Failed setenv to My Documents"); > + > + path = pci_get_sysfs_path(); > + TEST_ASSERT(strcmp(orig, path), > + "orig must be different from path: " I missed something here. Why different? > +DPDK_16.07 { > + global: > + > + pci_get_sysfs_path; > +} DPDK_16.04; I don't know why but we are used to put a blank line after the last symbol.