From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E86E42EB8; Wed, 19 Jul 2023 14:09:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D59B340DFD; Wed, 19 Jul 2023 14:09:50 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id BEEF440A80 for ; Wed, 19 Jul 2023 14:09:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689768590; x=1721304590; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=rd2E4aKt5Iq+Z/38F6dmHT6qhk//eD1BOwETbKpt6fk=; b=cE+IK2e9TsKMpFdiJgHP0+3Vo6jaYSGoabFQMB7siQwb3w+WLBCJwuP+ QiTHyQT6/joduVQn7PaViErtyEXZfdmXxNyP3j1BpXw7kI9+HfEWyz9MN Ni/6O5PPY827wJPCtAHvSrE5GhnnOJ816KYNURgu/ftXmJGiUyujPlklY aNsdXMiphMnT1wMFv0BPqc25nJ2tP6NuO0CDdRg8O3vWCKK171O5xlZeF okqbG1Yug/Yfd2HzcIU9sGdz3NcTWpFYTVATQsgLUkbb1YaoB1sB+pXcu wudPipoZgjfZnMvCimSmWnGXuCwfh9A+jssB3yJxr/F2qvx8FaWucr2eF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="432628467" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="432628467" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2023 05:09:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="793992869" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="793992869" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 19 Jul 2023 05:09:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 05:09:47 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 19 Jul 2023 05:09:47 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 19 Jul 2023 05:09:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=km/iZcl0JoW3TO7TX74wqbrLSW9KXe4nOsxg1WYBJ3iEHLZUrO3IyLukl/ls9gO/ygZXYz8SFVkScY86CAM4bHEQSR94VWmUVBfCIgijQph+mG9P9TlHObfhzUylmnHDjZ7VSeMNJWxSE3cDIs47K/AbsBV4c+HwmecHAUHK+/6BW9AkdStE5zX1HTVFJ03QJfzKLZMq61HGvdgnVfL9BvN3f5SXvNWz9r7sAH1J1/sF4ev2sJt5P03+o4Hw4oz5e8RkTFnQnqJbwVf+IoS+7gRJXdKjbM7aYOEs9yUYEEwzjdzEtuq5FY05tea6T1cLs48TMfvgQvSjE/0grGrv2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H7B3YRNPkQrOIpa/pGdP7/tKvchq1OCEOSZ3xi1LyTg=; b=dSH6zsUfTezve2ujIIXcuQ8nqPjuE2JgU4s+JRD/X5m5UxtCpycP3PHOtS6Tjnu8PzPc0wV8NCZk7aJRPcxmJbTQ7a+8NPRG/yYW4FzDyRcowR367rO69TJ9Jd1Ur+rEQ+lG7kHtXgbmuspbwHYtRc9R6OQ87cHNWV8A6m1yEyglG6afAjV8xt6+YAOO0vGls7REup6GOaz8b++r1UNtbPK8laRRkGw8+RgisDxFttlJ1O7Aty/WZam38/vYAOZo/2167oHHj4Ez1A3qQet2ZlV8Q7eqZGNAyP374E2F7GPqSkf1E/E/Hn7vvEuV52qk8ixJZ4bS5NpFPgZFQ02M6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by SA1PR11MB8254.namprd11.prod.outlook.com (2603:10b6:806:251::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul 2023 12:09:45 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::2670:725d:11b7:3ab1]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::2670:725d:11b7:3ab1%7]) with mapi id 15.20.6609.024; Wed, 19 Jul 2023 12:09:45 +0000 Message-ID: <00979f82-083a-b5a8-cc77-b4ed87b55930@intel.com> Date: Wed, 19 Jul 2023 13:09:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Subject: Re: [PATCH v16 6/6] test/memarea: support dump API test Content-Language: en-US To: Chengwen Feng , , CC: , , , , , References: <20220721044648.6817-1-fengchengwen@huawei.com> <20230710064923.19849-1-fengchengwen@huawei.com> <20230710064923.19849-7-fengchengwen@huawei.com> From: "Burakov, Anatoly" In-Reply-To: <20230710064923.19849-7-fengchengwen@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB8PR06CA0015.eurprd06.prod.outlook.com (2603:10a6:10:100::28) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|SA1PR11MB8254:EE_ X-MS-Office365-Filtering-Correlation-Id: e56d48bd-8d9d-4573-41e5-08db88510a1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z/gPKNlD6Nu/NI2smSKq7ObyvwNk4EbLlpx2rgvsv4NK7scgsfUBcdGlnUAyd0pGjCZQWp00X3QIyJjkt8XMhRjkTHGV33WoM4VpoJY/8CeNcRUtjggh2wVkb+/+iHVTYuRuGP6XoFb5f3oeLxEZ/4ZpfNTSSXbkZSLdTntJ+pn/xvP8sAX+hIWm+zsjl9YTCM643yuULlqBiXKwq6Hn6iBRdXCUCGaFV+ZEsEYWQG4uzkvayoOsqNIt1fjnp/sML4dv9vQh7kcob2B0arM5npEh0cozJC7FlfZbv4G9BTq0bQlYU/w5PsJfuAOzURnNbhbpG6re+MaMn91JrXQ90D3fHGCGz9w2ze7hRGnzct5Iwznf7P6JDuYfY16A/wf054FzE8mWxs1xjX29SfkOWQx2w1L5/1dgOFMO9AlpnmU0GquR6FNJgaTizsOMwFy8In51WZgrR97R2y1H0hX+xe5dekFthRbXmHYyUiWZaqsDRrJUufeHMr6w8HjZhjbg+zzV+XrOHRv1vGnIiwUsLzxByJH9GagAmg/RCsYBBhYbeCfX2ICiKjlLabWXbNlknXquDEw3zcMdrRfKGpPxlVV6uE9ZZOh6hXyeh+2rjuPEqjEh1QMaXnEyyLS55czTND5RKR4aUg+CcEveqOHr6g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(136003)(376002)(39860400002)(396003)(346002)(451199021)(6666004)(6486002)(82960400001)(478600001)(66476007)(36756003)(5660300002)(8676002)(8936002)(2906002)(86362001)(31696002)(4326008)(38100700002)(66946007)(66556008)(41300700001)(316002)(53546011)(6506007)(26005)(83380400001)(66574015)(2616005)(6512007)(186003)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R2xSRi9ld0ZEZld6cE9NU0RPem5jVTN3aDlzUUtrVXoyZTg1Y08wN0dyMHZn?= =?utf-8?B?cEJSSEV6cFU4V2p2UklYOU95UURsSm9zUEFVdzZWTmtUWEZrdEs1UFJNQ1U5?= =?utf-8?B?cE9hRFIzRUlsMDcycFQ3KysyWVlCM1piMDhGWnhmSlVPTGdjZE4zR25McWda?= =?utf-8?B?RVZDZUN6RWN1L3NHYlg0K3c3M2tDMnZTOUtRSWYrNlVXSXlzUVR0cFNOK05Z?= =?utf-8?B?RzNKb0FGZHJDTnlQb1dqVUltbmtpMzgzWG44TkFsK2pBR1ZubzBmY1J3MUFo?= =?utf-8?B?YnNRa3Y0KzVtaTNnSkpLdWJzR1NVYUtKWWhLMWY2ckhMcGdSdHJYUWVyd1dI?= =?utf-8?B?YTRDZXBOMTVzdDhWWDFKbUI4eGRqMjlTSWc1OTI5M3ZTUkpmVCtpZTl6dTFz?= =?utf-8?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e5-08db88510a1d X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:09:44.9039 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E84FZ8K8fpwhOFn9xKmWzoNe6GhvrjSM+7/ptgEA0FkpHoQB3YtUuJm6UBJwuosM1QZ/0N+1F6pFhpDA8B6lwWRaQQQ+aM45Ygc1i8oTwLk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB8254 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 7/10/2023 7:49 AM, Chengwen Feng wrote: > This patch supports rte_memarea_dump() API test. > > Signed-off-by: Chengwen Feng > Reviewed-by: Dongdong Liu > Acked-by: Morten Brørup > --- > app/test/test_memarea.c | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > > diff --git a/app/test/test_memarea.c b/app/test/test_memarea.c > index 4053cdcac9..6511a86699 100644 > --- a/app/test/test_memarea.c > +++ b/app/test/test_memarea.c > @@ -320,6 +320,45 @@ test_memarea_alloc_free(void) > > TEST_ASSERT(rte_errno == 0, "Expected Zero"); > > + fprintf(stderr, "There should have no allocated object.\n"); > + rte_memarea_dump(ma, stderr, true); > + > + rte_memarea_destroy(ma); > + > + return 0; > +} > + > +static int > +test_memarea_dump(void) > +{ > + struct rte_memarea_param init; > + struct rte_memarea *ma; > + int ret; > + > + test_memarea_init_param(&init); > + init.source = RTE_MEMAREA_SOURCE_LIBC; > + init.total_sz = MEMAREA_TEST_DEFAULT_SIZE; > + ma = rte_memarea_create(&init); > + TEST_ASSERT(ma != NULL, "Expected Non-NULL"); Here and in other places: I feel it's better to say *why* we expect non-NULL, or make the error message otherwise more meaningful, such as "Memarea creation failed". > + > + /* test for invalid parameters */ > + ret = rte_memarea_dump(NULL, stderr, false); > + TEST_ASSERT(ret == -1, "Expected -1"); > + TEST_ASSERT(rte_errno == EINVAL, "Expected EINVAL"); > + ret = rte_memarea_dump(ma, NULL, false); > + TEST_ASSERT(ret == -1, "Expected -1"); > + TEST_ASSERT(rte_errno == EINVAL, "Expected EINVAL"); > + > + /* test for dump */ > + (void)rte_memarea_alloc(ma, 1); > + (void)rte_memarea_alloc(ma, 1); > + (void)rte_memarea_alloc(ma, 1); > + (void)rte_memarea_alloc(ma, MEMAREA_TEST_DEFAULT_SIZE); > + (void)rte_memarea_alloc(ma, MEMAREA_TEST_DEFAULT_SIZE); > + fprintf(stderr, "There should have three allocated object.\n"); I question the value of this printout. > + ret = rte_memarea_dump(ma, stderr, true); > + TEST_ASSERT(ret == 0, "Expected ZERO"); > + > rte_memarea_destroy(ma); > > return 0; > @@ -337,6 +376,7 @@ static struct unit_test_suite memarea_test_suite = { > TEST_CASE(test_memarea_alloc_fail), > TEST_CASE(test_memarea_free_fail), > TEST_CASE(test_memarea_alloc_free), > + TEST_CASE(test_memarea_dump), > > TEST_CASES_END() /**< NULL terminate unit test array */ > } -- Thanks, Anatoly