From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.5011.1570758664462850659 for ; Thu, 10 Oct 2019 18:51:04 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: eric.jin@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2019 18:51:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,282,1566889200"; d="scan'208";a="219238713" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2019 18:51:02 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 10 Oct 2019 18:51:03 -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; Fri, 11 Oct 2019 09:51:01 +0800 From: "Eric Jin" To: "devel@edk2.groups.io" , "Liu, XianhuiX" CC: Heinrich Schuchardt , Supreeth Venkatesh Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Sync StrUpr() test change to IHV Thread-Topic: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Sync StrUpr() test change to IHV Thread-Index: AQHVfnkiO6gUmUIZnUiHsQPmONxjEqdTH1fwgAGQP4A= Date: Fri, 11 Oct 2019 01:51:01 +0000 Message-ID: References: <20191009081112.3248-1-xianhuix.liu@intel.com> <15CC2680403B89EE.14450@groups.io> In-Reply-To: <15CC2680403B89EE.14450@groups.io> 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 Pushed at a28541892a03dc34a7af5a8acdf0b39ad3daf7cc -----Original Message----- From: devel@edk2.groups.io On Behalf Of Eric Jin Sent: Thursday, October 10, 2019 9:58 AM To: Liu, XianhuiX ; devel@edk2.groups.io Cc: Heinrich Schuchardt ; Supreeth Venkatesh ; Jin, Eric Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Sync StrUpr(= ) test change to IHV Reviewed-by: Eric Jin -----Original Message----- From: Liu, XianhuiX 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 = IHV 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/= BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/U= EFI/IHV/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunc= tion.c index 7282034d..239be45b 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/UnicodeCollation2/BlackBo= xTest/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 B= SD 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\x6= 2\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\x6= 2\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\x6= 2\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\x6= 2\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 Te= st. @@ -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\x6= 1\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\x6= 1\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\x6= 1\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\x6= 1\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 @@ BBTestStriC= ollFunctionAutoTest ( } =20 UnicodeCollation =3D (EFI_UNICODE_COLLATION2_PROTOCOL *)ClientInterface= ; - for (Index =3D 0; Index < sizeof (TestData) / sizeof (STRICOLL_TEST_DAT= A_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 @@ BB= TestStriCollFunctionAutoTest ( 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 T= est. * @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_D= ATA_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 @@ = BBTestMetaiMatchFunctionAutoTest ( __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\x= 43\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"\x30\x50[abcdzyxw!)(@#*]\x= 40\x20\x30\x50\ab\x40\x20", - L"\x30\x50[A-D]\x40\x20\x30\= x50f\x40\x20", + =20 + L"\x30\x50[A-D]\x40\x20\x30\x50\x40\x20", L"" }; =20 -- 2.14.1.windows.1