From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.1282.1570672701948031600 for ; Wed, 09 Oct 2019 18:58:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: eric.jin@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 18:58:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="193855252" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 09 Oct 2019 18:58:20 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 18:58:20 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 18:58:20 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.165]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.96]) with mapi id 14.03.0439.000; Thu, 10 Oct 2019 09:58:18 +0800 From: "Eric Jin" To: "Liu, XianhuiX" , "devel@edk2.groups.io" CC: Heinrich Schuchardt , Supreeth Venkatesh , "Jin, Eric" Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg: Sync StrUpr() test change to IHV Thread-Topic: [edk2-test][Patch] uefi-sct/SctPkg: Sync StrUpr() test change to IHV Thread-Index: AQHVfnkiO6gUmUIZnUiHsQPmONxjEqdTH1fw Date: Thu, 10 Oct 2019 01:58:17 +0000 Message-ID: References: <20191009081112.3248-1-xianhuix.liu@intel.com> In-Reply-To: <20191009081112.3248-1-xianhuix.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.jin@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Jin -----Original Message----- From: Liu, XianhuiX =20 Sent: Wednesday, October 9, 2019 4:11 PM To: devel@edk2.groups.io Cc: Heinrich Schuchardt ; Supreeth Venkatesh ; Jin, Eric ; Liu, XianhuiX Subject: [edk2-test][Patch] uefi-sct/SctPkg: Sync StrUpr() test change to I= HV REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1911 sync commit cce43fc3ae30d343964fe02f09242ec8604eb44b on file EFI/Protocol/UnicodeCollation2/BlackBoxTest /UnicodeCollation2BBTestFunction.c to IHV Cc: Heinrich Schuchardt Cc: Supreeth Venkatesh Cc: Eric Jin Signed-off-by: xianhui liu --- .../BlackBoxTest/UnicodeCollation2BBTestFunction.c | 218 ++++++++++-------= ---- 1 file changed, 107 insertions(+), 111 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/UnicodeCollation2/B= lackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UE= FI/IHV/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunct= ion.c index 7282034d..239be45b 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/UnicodeCollation2/BlackBox= Test/UnicodeCollation2BBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/UnicodeCollation2/Black +++ BoxTest/UnicodeCollation2BBTestFunction.c @@ -1,7 +1,7 @@ /** @file =20 Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2019, Intel Corporation. All rights=20 + reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -28,6 +28,43 @@ Abstract: #include "SctLib.h" #include "UnicodeCollation2BBTestMain.h" =20 +STATIC CONST STRICOLL_TEST_DATA_FIELD mStriCollTestData[] =3D{ + { + L"", + L"", + STRING_COMPARE_EQUAL + }, + { + L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\x49\= x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5Ax61\x62\= x7D\x7E", + L"\x01\x02\x11\x12\x21\x22\x31\x32\x61\x62\x63\x64\x65\x66\x67\x68\x69\= x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7Ax61\x62\= x7D\x7E", + STRING_COMPARE_EQUAL + }, + { + L"\x01\x02\x11\x12\x21\x22\x31\x32\x61\x62\x63\x64\x65\x66\x67\x68\x69\= x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7Ax61\x62\= x7D\x7E", + L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\x49\= x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5Ax61\x62\= x7D\x7E", + STRING_COMPARE_EQUAL + }, + { + L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\x49\= x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61\x62= \x7D\x7E", + L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\x49\= x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61\x62= \x7D\x7D", + STRING_COMPARE_MORE + }, + { + L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\x49\= x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61\x62= \x7D\x7E", + L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\x49\= x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61\x62= \x7D\x7F", + STRING_COMPARE_LESS + }, + { + L"\x01", + L"", + STRING_COMPARE_MORE + }, + { + L"", + L"\x01\x02", + STRING_COMPARE_LESS + }, +}; =20 /** * Entrypoint for EFI_UNICODE_COLLATOIN2_PROTOCOL.StriColl() Function Tes= t. @@ -59,45 +96,6 @@ BBTestStriCollFunctionAutoTest ( // // Test Data // - STRICOLL_TEST_DATA_FIELD TestData[] =3D{ - { - L"", - L"", - STRING_COMPARE_EQUAL - }, - { - L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\= x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5Ax61\= x62\x7D\x7E", - L"\x01\x02\x11\x12\x21\x22\x31\x32\x61\x62\x63\x64\x65\x66\x67\x68\= x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7Ax61\= x62\x7D\x7E", - STRING_COMPARE_EQUAL - }, - { - L"\x01\x02\x11\x12\x21\x22\x31\x32\x61\x62\x63\x64\x65\x66\x67\x68\= x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7Ax61\= x62\x7D\x7E", - L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\= x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5Ax61\= x62\x7D\x7E", - STRING_COMPARE_EQUAL - }, - { - L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\= x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61= \x62\x7D\x7E", - L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\= x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61= \x62\x7D\x7D", - STRING_COMPARE_MORE - }, - { - L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\= x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61= \x62\x7D\x7E", - L"\x01\x02\x11\x12\x21\x22\x31\x32\x41\x42\x43\x44\x45\x46\x47\x48\= x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61= \x62\x7D\x7F", - STRING_COMPARE_LESS - }, - { - L"\x01", - L"", - STRING_COMPARE_MORE - }, - { - L"", - L"\x01\x02", - STRING_COMPARE_LESS - }, - }; - - =20 // // Get the Standard Library Interface @@ -123,19 +121,19 @@ BBTestStriCo= llFunctionAutoTest ( } =20 UnicodeCollation =3D (EFI_UNICODE_COLLATION2_PROTOCOL *)ClientInterface; - for (Index =3D 0; Index < sizeof (TestData) / sizeof (STRICOLL_TEST_DATA= _FIELD); Index++) { + for (Index =3D 0; Index < sizeof (mStriCollTestData) / sizeof=20 + (STRICOLL_TEST_DATA_FIELD); Index++) { // // For each test data, test the StriColl functionality. // Result =3D UnicodeCollation->StriColl ( UnicodeCollation, - TestData[Index].S1, - TestData[Index].S2 + mStriCollTestData[Index].S1, + mStriCollTestData[Index].S2 ); =20 - if ((Result < 0) && (TestData[Index].Result < 0) || - (Result =3D=3D 0) && (TestData[Index].Result =3D=3D 0) || - (Result > 0) && (TestData[Index].Result > 0)) { + if (((Result < 0) && (mStriCollTestData[Index].Result < 0)) || + ((Result =3D=3D 0) && (mStriCollTestData[Index].Result =3D=3D 0)) || + ((Result > 0) && (mStriCollTestData[Index].Result > 0))) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; @@ -149,8 +147,8 @@ BBT= estStriCollFunctionAutoTest ( L"%a:%d: S1=3D'%s', S2=3D'%s', Result=3D%d", __FILE__, (UINTN)__LINE__, - TestData[Index].S1, - TestData[Index].S2, + mStriCollTestData[Index].S1, + mStriCollTestData[Index].S2, Result ); }; @@ -159,6 +157,59 @@ BBTestStriCollFunctionAutoTest ( } =20 =20 +// +// Test Data +// +STATIC CONST METAIMATCH_TEST_DATA_FIELD mMetaiMatchTestData[] = =3D{ + {L"", L"\x30\x50zz\x40\x20", FALSE}, + {L"\x30\x50*\x40\x20", L"", FALSE}, + {L"", L"", TRUE}, + {L"\x30\x50*\x40\x20", L"\x30\x50zz\x40\x20", TRUE}, + {L"\x30\x50*\x40\x20", L"\x30\x50\x30\x20", FALSE}, + + {L"\x30\x50?\x40\x20", L"\x30\x50H\x40\x20", TRUE}, + {L"\x30\x50?\x40\x20", L"\x30\x50\x40\x20", FALSE}, + + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50Z\x40\x20", TRUE}, + {L"\x30\x50[abcdZyxw!)(@#*]\x40\x20", L"\x30\x50Z\x40\x20", TRUE}, + {L"\x30\x50[abcdZyxw!)(@#*]\x40\x20", L"\x30\x50z\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50z\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50W\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50w\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50@\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50*\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*?]\x40\x20", L"\x30\x50?\x40\x20", TRUE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50g\x40\x20", FALSE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50q\x40\x20", FALSE}, + {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50W\x40\x20", TRUE}, + +// +// Index =3D 19 +// + {L"[a-z]", L"b", TRUE}, + {L"[a-z]", L"B", TRUE}, + {L"[bcd]", L"B", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50r\x40\x20", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50R\x40\x20", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50Z\x40\x20", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50z\x40\x20", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50Y\x40\x20", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50s\x40\x20", TRUE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50k\x40\x20", FALSE}, + {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50K\x40\x20", FALSE}, + + +// +// Index =3D 30 +// + + {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x20\x40\x20", TRUE}, + {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x25\x40\x20", TRUE}, + {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x22\x40\x20", TRUE}, + {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x10\x40\x20", FALSE}, + +}; + /** * Entrypoint for EFI_UNICODE_COLLATOIN_PROTOCOL.MetaiMatch() Function Te= st. * @param This a pointer of EFI_BB_TEST_PROTOCOL. @@ -186,61 +237,6 @@ BBTestMetaiMatchFunctionAutoTest ( BOOLEAN Result; EFI_TEST_ASSERTION AssertionType; =20 - // - // Test Data - // - METAIMATCH_TEST_DATA_FIELD TestData[] =3D{ - {L"", L"\x30\x50zz\x40\x20", FALSE}, - {L"\x30\x50*\x40\x20", L"", FALSE}, - {L"", L"", TRUE}, - {L"\x30\x50*\x40\x20", L"\x30\x50zz\x40\x20", TRUE}, - {L"\x30\x50*\x40\x20", L"\x30\x50\x30\x20", FALSE}, - - {L"\x30\x50?\x40\x20", L"\x30\x50H\x40\x20", TRUE}, - {L"\x30\x50?\x40\x20", L"\x30\x50\x40\x20", FALSE}, - - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50Z\x40\x20", TRUE}, - {L"\x30\x50[abcdZyxw!)(@#*]\x40\x20", L"\x30\x50Z\x40\x20", TRUE}, - {L"\x30\x50[abcdZyxw!)(@#*]\x40\x20", L"\x30\x50z\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50z\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50W\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50w\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50@\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50*\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*?]\x40\x20", L"\x30\x50?\x40\x20", TRUE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50g\x40\x20", FALSE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50q\x40\x20", FALSE}, - {L"\x30\x50[abcdzyxw!)(@#*]\x40\x20", L"\x30\x50W\x40\x20", TRUE}, - -// -// Index =3D 19 -// - {L"[a-z]", L"b", TRUE}, - {L"[a-z]", L"B", TRUE}, - {L"[bcd]", L"B", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50r\x40\x20", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50R\x40\x20", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50Z\x40\x20", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50z\x40\x20", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50Y\x40\x20", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50s\x40\x20", TRUE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50k\x40\x20", FALSE}, - {L"\x30\x50[R-Z]\x40\x20", L"\x30\x50K\x40\x20", FALSE}, - - -// -// Index =3D 30 -// - - {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x20\x40\x20", TRUE}, - {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x25\x40\x20", TRUE}, - {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x22\x40\x20", TRUE}, - {L"\x30\x50[\x20-\x25]\x40\x20", L"\x30\x50\x10\x40\x20", FALSE}, - - }; - - - // // Get the Standard Library Interface // @@ -265,17 +261,17 @@ BBTestMetaiMatchFunctionAutoTest ( } =20 UnicodeCollation =3D (EFI_UNICODE_COLLATION2_PROTOCOL *)ClientInterface; - for (Index =3D 0; Index < sizeof (TestData) / sizeof (METAIMATCH_TEST_DA= TA_FIELD); Index ++) { + for (Index =3D 0; Index < sizeof (mMetaiMatchTestData) / sizeof=20 + (METAIMATCH_TEST_DATA_FIELD); Index ++) { // // For each test data, test the MetaiMatch functionality. // Result =3D UnicodeCollation->MetaiMatch ( UnicodeCollation, - TestData[Index].String, - TestData[Index].Pattern + mMetaiMatchTestData[Index].String, + mMetaiMatchTestData[Index].Pattern ); =20 - if (Result =3D=3D TestData[Index].Result) { + if (Result =3D=3D mMetaiMatchTestData[Index].Result) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; @@ -290,10 +286,10 @@ B= BTestMetaiMatchFunctionAutoTest ( __FILE__, (UINTN)__LINE__, Index, - TestData[Index].String, - TestData[Index].Pattern, + mMetaiMatchTestData[Index].String, + mMetaiMatchTestData[Index].Pattern, Result, - TestData[Index].Result + mMetaiMatchTestData[Index].Result ); }; =20 @@ -455,7 +451,7 @@ BBTestStrUprFunctionAutoTest ( CHAR16 *TestData[] =3D{ L"\x21\x22\x31\x32\x41\x42\x4= 3\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x= 56\x57\x58\x59\x5Ax61\x62\x7D\x7E", L"\x30\x50[abcdzyxw!)(@#*]\x4= 0\x20\x30\x50\ab\x40\x20", - L"\x30\x50[A-D]\x40\x20\x30\x= 50f\x40\x20", + =20 + L"\x30\x50[A-D]\x40\x20\x30\x50\x40\x20", L"" }; =20 -- 2.14.1.windows.1