From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.6948.1627547143819383533 for ; Thu, 29 Jul 2021 01:25:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=znhaNHl/; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10059"; a="276611509" X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="276611509" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2021 01:25:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="418061279" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga003.jf.intel.com with ESMTP; 29 Jul 2021 01:25:43 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Thu, 29 Jul 2021 01:25:42 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2242.10 via Frontend Transport; Thu, 29 Jul 2021 01:25:42 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 29 Jul 2021 01:25:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDb+isRap7Klftgql6pLmmVOlCzE626G+1ogPX73toCtyXHaGvaWJSsNZIIxpvOYGcO6lwcvK7C4zdgTQYPNc31KTPLs70yB4OcZ0I/gXS1H+jpcpIEK7v9+9j6XdgxB0U50IDCgbxeGmGmpBSvreoZZp0KTlK9zTfVnJR8UBTQsH+sZUqhOHI1SRT88g2ZSYOZgYz+x12ZL3rdwjgrGHLL3ubyAHv4WVKAOqMlr0I46B7gpuKmlhducq79dD8/WsvVt5Lx5uBPccDNstp93XxEiBsAq8e53el83TU9pU8d0wxQs6e5U+irVr29dA6kqLlkXXBcZfYzoIA1CcmqTMQ== 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-SenderADCheck; bh=W9MgN55vdkP8dyYVwweh7ynIQleeugXnOmY49U0q+aA=; b=h+fiQhX33pAlKELysn5TLd+nIzoWR8dV3+ZuKed1QmAr/YRBvUQD6UKuvPN5hGka+ZocM6q2lYbbdpn1wZuKdshkUdggfNKbORR2BooDFekf6Ty/PgJYJ8d9dVicEroOiUzG8f5iIGuLM6mq8K15vvvL8HeU5FISU1YKoxc2I+mZ5i2DWe6XxNwhaxjCvqSr0xFBzbJJs6mwH4H/VI3vTUY5Hx+qXjPcNU5yYrIWUXQbYtU5BZkYrRmPWjBgBrXIH/kGhstV2NKJpo85EPx65cMUXocPRilzW6uk46GbZJCX4NFXNaPVAvIeOUioGfMRC0fXOuzg9xeXKDprpKWaag== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W9MgN55vdkP8dyYVwweh7ynIQleeugXnOmY49U0q+aA=; b=znhaNHl/iD6RiLk+CoXoAVCvHxErYMOCl3jO+VIcIceM0ebV3RHKIEIcTx1GKKcqM+Bguvsg6Sz4Y62EK3PVldiTPZRdlhlTvXQJCXTTsy8thwaSXYDO6yOdmZQMx4iPzi5l9txqTbZiWNoOe1Pw+AaXH9xheVhFQ52AELABREA= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR1101MB2308.namprd11.prod.outlook.com (2603:10b6:405:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Thu, 29 Jul 2021 08:25:41 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d%5]) with mapi id 15.20.4373.022; Thu, 29 Jul 2021 08:25:41 +0000 From: "Wu, Hao A" To: Wenyi Xie , "devel@edk2.groups.io" , "Wang, Jian J" CC: "songdongkuang@huawei.com" Subject: Re: [PATCH EDK2 v2 1/1] MdeModulePkg/UefiSortLib:Add UefiSortLib unit test Thread-Topic: [PATCH EDK2 v2 1/1] MdeModulePkg/UefiSortLib:Add UefiSortLib unit test Thread-Index: AQHXhFCY+A90Om5Y5UC1zTkAVbhwTqtZneIA Date: Thu, 29 Jul 2021 08:25:41 +0000 Message-ID: References: <1627545672-84944-1-git-send-email-xiewenyi2@huawei.com> <1627545672-84944-2-git-send-email-xiewenyi2@huawei.com> In-Reply-To: <1627545672-84944-2-git-send-email-xiewenyi2@huawei.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a04d7f09-b6d4-4e0f-6d4b-08d9526a73c5 x-ms-traffictypediagnostic: BN6PR1101MB2308: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hTChX0rZIWBaE3GJb/reJvIqEL3QjubMeuRb4UUfzTuS8lC9wFCSnYZ/fmwupm3z4EtHQXaXy+ZIYCi+Kqcc/4lfTSW/KvOxglGKGytcRGjLFwp1tMqe3Q3uubWO+HYSvK58RFld0WyeXN9k8Ft6lj7m8P+5c9hKHyE0061iLEZeQoUWpU2pCAqYN2ZGP8GT+7WG8qbYVs7fCA8Pj/BNenb8bIAGZer966D/bqc0r6poMj2un+H6jqL4BpRT/OY7oXmgR2D3U5wbr8fzkHhoR1m3NNEzCtQFN8Kla+Z0R46Zy0yQjmfm3K5z/LP99bUqZmw1BenZMKdjVoUg9ncdFtGpvdEsqpFDYMv/RLKsuNadtp68ygozmWaYla0ypeR9hDzwsrGACUdNxWbg/Acd3+0hjhfUgjZum3rtHnI2WG76+DRtmVfsipyeFD6enRs14BDrwM1aKQy9udihR+Yk1WpZgrDDDqO4J++k49YfCQdnnpkKRRP4uIKvy9ks4XDVb9q0X/UMqbThU0akoL4p4ywhlXvCYCm9OQQ5cP1dHUcc89QkuexBZ23+d/T5Ln3mfQ+D2kPgLNkfj4SkTiGgcEpnwYlwaEjLVTn6MMl8WXvbR2Nx/HXFtM/Cb/m/u/wwprhacXAkqWwZVHpRk4vhZCrjfYReB1q5KtuC/+mMLiYKashpF5mfSRTIBSXNKyOuPxrvGsMhjtdlDLLaqenrRw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(110136005)(38100700002)(66446008)(83380400001)(26005)(33656002)(64756008)(508600001)(55016002)(8676002)(186003)(8936002)(122000001)(66946007)(71200400001)(76116006)(66556008)(9686003)(66476007)(6636002)(86362001)(2906002)(52536014)(4326008)(7696005)(38070700005)(316002)(5660300002)(53546011)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FFqga+HeXUAvCKaZuh7pQEZ29570booKcMZb566gU0TOa/NzCocxRxMGp6p5?= =?us-ascii?Q?UhPfy8ekRbwWGekWTCt9LmLcGlT99qJ0ui730Rv5ZRcejb7rd4JP/7Wcovy8?= =?us-ascii?Q?hkY8MkX2PDUJ+tZH2MHC9ivynHxpOaOzYUTr+rifyJCfbjCGjzd/dObbUmTt?= =?us-ascii?Q?fbEZfHQyt7zPm6D/avVNCelDgF8InZ5qWMoFN2Qp0ip7eQH2tInVlXKrgGzv?= =?us-ascii?Q?Zb0c/WMQ4E4VF6ewmn3S7zG6cuWkSbY0Mv5tXxF8VqYVA+FPJi5WwQpF0pcZ?= =?us-ascii?Q?i8vssVt1ua0VB6c3wOaWf3g9YdJtsyI3GF1Aq6v/ft13qwv78/A9iwkeFeip?= =?us-ascii?Q?faUdmpSaonU/RHv5easV6WNrzi0qZaKvrEFcxpjc8bnLAFhZOc1CjVSdJhDK?= =?us-ascii?Q?TgCBsiTgx/FjsFBDDXR9+Q6FD6fT5RMHNS9rKqnq2pdT7usmCmqYgZMHoDaw?= =?us-ascii?Q?7PZJSH0YYIlcjgvY22B93vumI9CkFU7BT+FKhTdSLWdGyb14INBGwJ5Ygj0E?= =?us-ascii?Q?fgMQ43Xyq4khDJ7Bd/FSzbZY747qQB8idzqVZfJWR9l3ywW0SEO//V4TcG4S?= =?us-ascii?Q?CsslwdY0tZaT3otShD66A8h1JhzBBvDjhEGDuh5rQFK0X4A7idAlErLIbOVP?= =?us-ascii?Q?po1HEjaVx7Z3RCQL5zcQ75Cg2Oza8n37FhbPFjiT23EWeRu7alHRLaEZSYPZ?= =?us-ascii?Q?kjDeF0qj3BiSeJ/5Fk844WhOaPeSZvMOd6JOJC80Umf3CBsB+mB82ngoLZve?= =?us-ascii?Q?j0H+tPrYZU9sLzNK8EDhoGoMoIyxazo58mRIUkptpZIzd3H+2XZdpehFwzP6?= =?us-ascii?Q?YM6du2ZjnQYAKvO/rPa2t3qfe6gscDRi35Ftyw7a43zq7YgAw9DHsgG5adf+?= =?us-ascii?Q?RLO5TSX7A6wsWmhawQXLUS7Xbo/+YO2AEdR9yMRK5m3CHB8JPp1N6g9cDt0o?= =?us-ascii?Q?2p6nFj0whYHyBEPl2rojbg3PKdz+CVTis2lF2fPuY+fdijfDFKCrSxLG1EtU?= =?us-ascii?Q?xwp1kAyFPxL8RsF5vLpIt/fvS3JxB0KIdS8EkCbh1zV7Z5HmiXrxScFip90w?= =?us-ascii?Q?Jk6abbY8O1DjgqOkJNYRlrbOBdYrvcjkk4tfp/CoqcWtXRzNpfP1Onvu6sd8?= =?us-ascii?Q?ZBi6HwW8BISXh6FSX9TMupuT88cm7QZDdX71S/I/33UCEsOySwbgrftVgFk3?= =?us-ascii?Q?OkPESevxQLbsi2YIcIXI5YvANmj4vYT2SmlrWRhaCiiFb7fMon6LWGmsVdt4?= =?us-ascii?Q?km1XzS9w6rtyHP2NrTGYDlT2SCNGMrW15EJhbuVdtjiMhYQpMnlpwoaKQtQp?= =?us-ascii?Q?7AMUbMVxmuxGX6piGXYz7RAO?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a04d7f09-b6d4-4e0f-6d4b-08d9526a73c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jul 2021 08:25:41.0945 (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: EadWOlnmtOADhrO0UPlY7HgY3TIey0rRZGF2z5rgC780wFY48UM07PnSucqniqDyueeevl7lkTGkPMkY6SV64g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2308 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Wenyi Xie > Sent: Thursday, July 29, 2021 4:01 PM > To: devel@edk2.groups.io; Wang, Jian J ; Wu, Hao A > > Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com > Subject: [PATCH EDK2 v2 1/1] MdeModulePkg/UefiSortLib:Add UefiSortLib > unit test >=20 > Adding two unit test case for UefiSortLib. One is a test on sorting an ar= ray of > UINT32 by using PerformQuickSort, another is a test on comparing the same > buffer by using StringCompare. Thanks. Reviewed-by: Hao A Wu I will wait a couple days before merging to see if any additional comment f= rom other reviewers. Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Signed-off-by: Wenyi Xie > --- > MdeModulePkg/Test/MdeModulePkgHostTest.dsc | 6 = + > MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.inf | 32 > ++++ > MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.c | 188 > ++++++++++++++++++++ > 3 files changed, 226 insertions(+) >=20 > diff --git a/MdeModulePkg/Test/MdeModulePkgHostTest.dsc > b/MdeModulePkg/Test/MdeModulePkgHostTest.dsc > index 4da4692c8451..c9ec835df65d 100644 > --- a/MdeModulePkg/Test/MdeModulePkgHostTest.dsc > +++ b/MdeModulePkg/Test/MdeModulePkgHostTest.dsc > @@ -41,3 +41,9 @@ [Components] > >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdAllowVariablePolicyEnforcementDis > able|TRUE > } > + > + MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.inf { > + > + UefiSortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf > + > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + } > diff --git > a/MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.inf > b/MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.inf > new file mode 100644 > index 000000000000..85d8dcd69619 > --- /dev/null > +++ b/MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.inf > @@ -0,0 +1,32 @@ > +## @file > +# This is a unit test for the UefiSortLib. > +# > +# Copyright (C) Huawei Technologies Co., Ltd. All rights reserved # > +SPDX-License-Identifier: BSD-2-Clause-Patent ## > + > +[Defines] > + INF_VERSION =3D 0x00010017 > + BASE_NAME =3D UefiSortLibUnitTest > + FILE_GUID =3D 271337A3-0D79-BA3E-BC03-714E518E3B1B > + VERSION_STRING =3D 1.0 > + MODULE_TYPE =3D HOST_APPLICATION > + > +# > +# The following information is for reference only and not required by th= e > build tools. > +# > +# VALID_ARCHITECTURES =3D IA32 X64 > +# > + > +[Sources] > + UefiSortLibUnitTest.c > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec > + > +[LibraryClasses] > + UnitTestLib > + DebugLib > + UefiSortLib > diff --git > a/MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.c > b/MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.c > new file mode 100644 > index 000000000000..71f30d8b9f7f > --- /dev/null > +++ b/MdeModulePkg/Library/UefiSortLib/UnitTest/UefiSortLibUnitTest.c > @@ -0,0 +1,188 @@ > +/** @file > + Unit tests of the UefiSortLib > + > + Copyright (C) Huawei Technologies Co., Ltd. All rights reserved > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#define UNIT_TEST_APP_NAME "UefiSortLib Unit Tests" > +#define UNIT_TEST_APP_VERSION "1.0" > + > +#define TEST_ARRAY_SIZE_9 9 > + > +/** > + The function is called by PerformQuickSort to compare int values. > + > + @param[in] Left The pointer to first buffer. > + @param[in] Right The pointer to second buffer. > + > + @retval 0 Buffer1 equal to Buffer2. > + @return <0 Buffer1 is less than Buffer2. > + @return >0 Buffer1 is greater than Buffer2. > + > +**/ > +INTN > +EFIAPI > +TestCompareFunction ( > + IN CONST VOID *Left, > + IN CONST VOID *Right > + ) > +{ > + if (*(UINT32*)Right > *(UINT32*)Left) { > + return 1; > + } else if (*(UINT32*)Right < *(UINT32*)Left) { > + return -1; > + } > + > + return 0; > +} > + > +/** > + Unit test for PerformQuickSort () API of the UefiSortLib. > + > + @param[in] Context [Optional] An optional parameter that enables: > + 1) test-case reuse with varied parameters and > + 2) test-case re-entry for Target tests that nee= d a > + reboot. This parameter is a VOID* and it is th= e > + responsibility of the test author to ensure tha= t the > + contents are well understood by all test cases = that may > + consume it. > + > + @retval UNIT_TEST_PASSED The Unit test has completed and = the > test > + case was successful. > + @retval UNIT_TEST_ERROR_TEST_FAILED A test case assertion has failed= . > +**/ > +UNIT_TEST_STATUS > +EFIAPI > +SortUINT32ArrayShouldSucceed ( > + IN UNIT_TEST_CONTEXT Context > + ) > +{ > + UINTN TestCount =3D TEST_ARRAY_SIZE_9; > + UINT32 TestBuffer[TEST_ARRAY_SIZE_9] =3D {1, 2, 3, 4, 5, 6, 7 ,8, 9}; > + UINT32 TestResult[TEST_ARRAY_SIZE_9] =3D {9, 8, 7, 6, 5, 4, 3, 2, 1}; > + > + PerformQuickSort (TestBuffer, TestCount, sizeof (UINT32), > + (SORT_COMPARE)TestCompareFunction); > + UT_ASSERT_MEM_EQUAL (TestBuffer, TestResult, sizeof (UINT32) * > + TEST_ARRAY_SIZE_9); > + > + return UNIT_TEST_PASSED; > +} > + > +/** > + Unit test for StringCompare () API of the UefiSortLib. > + > + @param[in] Context [Optional] An optional parameter that enables: > + 1) test-case reuse with varied parameters and > + 2) test-case re-entry for Target tests that nee= d a > + reboot. This parameter is a VOID* and it is th= e > + responsibility of the test author to ensure tha= t the > + contents are well understood by all test cases = that may > + consume it. > + > + @retval UNIT_TEST_PASSED The Unit test has completed and = the > test > + case was successful. > + @retval UNIT_TEST_ERROR_TEST_FAILED A test case assertion has failed= . > +**/ > +UNIT_TEST_STATUS > +EFIAPI > +CompareSameBufferShouldSucceed ( > + IN UNIT_TEST_CONTEXT Context > + ) > +{ > + INTN retval; > + CONST CHAR16* TestBuffer[] =3D { L"abcdefg" }; > + > + retval =3D StringCompare (TestBuffer, TestBuffer); UT_ASSERT_TRUE > + (retval =3D=3D 0); > + > + return UNIT_TEST_PASSED; > +} > + > +/** > + Initialze the unit test framework, suite, and unit tests for the > + UefiSortLib and run the UefiSortLib unit test. > + > + @retval EFI_SUCCESS All test cases were dispatched. > + @retval EFI_OUT_OF_RESOURCES There are not enough resources > available to > + initialize the unit tests. > +**/ > +STATIC > +EFI_STATUS > +EFIAPI > +UnitTestingEntry ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UNIT_TEST_FRAMEWORK_HANDLE Framework; > + UNIT_TEST_SUITE_HANDLE SortTests; > + > + Framework =3D NULL; > + > + DEBUG(( DEBUG_INFO, "%a v%a\n", UNIT_TEST_APP_NAME, > + UNIT_TEST_APP_VERSION )); > + > + // > + // Start setting up the test framework for running the tests. > + // > + Status =3D InitUnitTestFramework (&Framework, UNIT_TEST_APP_NAME, > + gEfiCallerBaseName, UNIT_TEST_APP_VERSION); if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "Failed in InitUnitTestFramework. Status > =3D %r\n", Status)); > + goto EXIT; > + } > + > + // > + // Populate the UefiSortLib Unit Test Suite. > + // > + Status =3D CreateUnitTestSuite (&SortTests, Framework, "UefiSortLib > + Sort Tests", "UefiSortLib.SortLib", NULL, NULL); if (EFI_ERROR (Status= )) { > + DEBUG ((DEBUG_ERROR, "Failed in CreateUnitTestSuite for UefiSortLib > API Tests\n")); > + Status =3D EFI_OUT_OF_RESOURCES; > + goto EXIT; > + } > + > + // > + // > + --------------Suite--------Description------------Name--------------Fu > + nction----------------Pre---Post---Context----------- > + // > + AddTestCase (SortTests, "Sort the Array", "Sort", > SortUINT32ArrayShouldSucceed, NULL, NULL, NULL); > + AddTestCase (SortTests, "Compare the Buffer", "Compare", > CompareSameBufferShouldSucceed, NULL, NULL, NULL); > + > + // > + // Execute the tests. > + // > + Status =3D RunAllTestSuites (Framework); > + > +EXIT: > + if (Framework) { > + FreeUnitTestFramework (Framework); > + } > + > + return Status; > +} > + > +/** > + Standard POSIX C entry point for host based unit test execution. > +**/ > +int > +main ( > + int argc, > + char *argv[] > + ) > +{ > + return UnitTestingEntry (); > +} > -- > 2.20.1.windows.1