From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9BE9698 for ; Tue, 24 Jul 2018 16:53:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 07:53:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,398,1526367600"; d="scan'208";a="60262216" Received: from rhorton-mobl1.ger.corp.intel.com (HELO [163.33.179.30]) ([163.33.179.30]) by orsmga006.jf.intel.com with ESMTP; 24 Jul 2018 07:53:56 -0700 To: Hari kumar Vemula , dev@dpdk.org References: <1530776231-17707-1-git-send-email-hari.kumarx.vemula@intel.com> <1532183219-23263-1-git-send-email-hari.kumarx.vemula@intel.com> Cc: reshma.pattan@intel.com From: Remy Horton Organization: Intel Shannon Limited Message-ID: Date: Tue, 24 Jul 2018 15:53:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1532183219-23263-1-git-send-email-hari.kumarx.vemula@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] test: add unit tests for metrics library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 14:54:00 -0000 Tested using the following patches also applied: http://patches.dpdk.org/patch/42097/ http://patches.dpdk.org/patch/42098/ http://patches.dpdk.org/patch/42510/ http://patches.dpdk.org/patch/42971/ Two test-cases fail, but these in themselves ought not block this patch. Details below. Acked-by: Remy Horton > + /* Test Case to check failures when memzone init is not done */ > +static int > +test_metrics_without_init(void) > +{ > + int err = 0; > + const uint64_t value[REG_METRIC_COUNT] = {0}; > + const char * const mnames[] = { > + "mean_bits_in", "mean_bits_out", > + "peak_bits_in", "peak_bits_out", > + }; > + > + /* Failure Test: Checking for memzone initialization */ > + err = rte_metrics_reg_name(NULL); > + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); Returns -EINVAL instead of -EIO due to NULL check coming before memzone check. Suggest using non-NULL value. > +/* Test case to validate update a list of metrics */ > +static int > +test_metrics_update_values(void) > +{ [..] > + /* Failed Test: Invalid count size */ > + err = rte_metrics_update_values(RTE_METRICS_GLOBAL, > + KEY, &value[0], 0); > + TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__); Test fails, fault with library: Silent handling length of zero. Will send patch.