public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test][Patch] uefi-sct\SctPkg: Add checkpoint of LocateProtocol()
@ 2018-10-12  1:52 Eric Jin
  2018-10-12  8:35 ` Supreeth Venkatesh
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Jin @ 2018-10-12  1:52 UTC (permalink / raw)
  To: edk2-devel; +Cc: Supreeth Venkatesh, Jiaxin Wu

Clarify return value for NULL pointer in LocateProtocol() API
When input parameter Protocol is NULL, EFI_INVALID_PARAMETER
should be returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <eric.jin@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
---
 .../ProtocolHandlerServices/BlackBoxTest/Guid.c    |  8 +++----
 .../ProtocolHandlerServices/BlackBoxTest/Guid.h    | 12 ++++------
 .../ProtocolHandlerBBTestConformance.c             | 27 +++++++++++++++++++++-
 3 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c
index 4069d2f..40927f7 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -44,7 +44,7 @@ EFI_GUID gConsistencyTestAssertionGuid007 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0
 
 EFI_GUID gConsistencyTestAssertionGuid008 = EFI_TEST_CONSISTENCYTEST_ASSERTION_008_GUID;
 
-//EFI_GUID gConsistencyTestAssertionGuid009 = EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID;
+EFI_GUID gConsistencyTestAssertionGuid009 = EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID;
 
 EFI_GUID gConsistencyTestAssertionGuid010 = EFI_TEST_CONSISTENCYTEST_ASSERTION_010_GUID;
 
@@ -70,7 +70,7 @@ EFI_GUID gConsistencyTestAssertionGuid020 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0
 
 EFI_GUID gConsistencyTestAssertionGuid021 = EFI_TEST_CONSISTENCYTEST_ASSERTION_021_GUID;
 
-EFI_GUID gConsistencyTestAssertionGuid022 = EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID;
+//EFI_GUID gConsistencyTestAssertionGuid022 = EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID;
 
 EFI_GUID gConsistencyTestAssertionGuid023 = EFI_TEST_CONSISTENCYTEST_ASSERTION_023_GUID;
 
@@ -140,7 +140,7 @@ EFI_GUID gConsistencyTestAssertionGuid055 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0
 
 EFI_GUID gConsistencyTestAssertionGuid056 = EFI_TEST_CONSISTENCYTEST_ASSERTION_056_GUID;
 
-EFI_GUID gConsistencyTestAssertionGuid057 = EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID;
+//EFI_GUID gConsistencyTestAssertionGuid057 = EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID;
 
 EFI_GUID gConsistencyTestAssertionGuid058 = EFI_TEST_CONSISTENCYTEST_ASSERTION_058_GUID;
 
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h
index 06fbc80..d42d968 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -65,12 +65,10 @@ extern EFI_GUID gConsistencyTestAssertionGuid007;
 
 extern EFI_GUID gConsistencyTestAssertionGuid008;
 
-/*
 #define EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID \
 { 0xe9712c64, 0x302e, 0x4984, {0x9e, 0xc2, 0xb9, 0x91, 0xd3, 0x5e, 0x2e, 0x11 }}
 
 extern EFI_GUID gConsistencyTestAssertionGuid009;
-*/
 
 #define EFI_TEST_CONSISTENCYTEST_ASSERTION_010_GUID \
 { 0xf7c8a812, 0x97c8, 0x4283, {0xa7, 0x79, 0x9c, 0x3a, 0x0d, 0xf9, 0x9b, 0x44 }}
@@ -131,12 +129,12 @@ extern EFI_GUID gConsistencyTestAssertionGuid020;
 { 0x0df6b782, 0xbb9c, 0x40e1, {0x99, 0x31, 0xfa, 0x07, 0xce, 0x4e, 0xf3, 0x2d }}
 
 extern EFI_GUID gConsistencyTestAssertionGuid021;
-
+/*
 #define EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID \
 { 0x8508de3d, 0x795d, 0x4833, {0x8c, 0xe2, 0x3c, 0xf9, 0x60, 0x05, 0x50, 0x5b }}
 
 extern EFI_GUID gConsistencyTestAssertionGuid022;
-
+*/
 #define EFI_TEST_CONSISTENCYTEST_ASSERTION_023_GUID \
 { 0x6cad11b3, 0x9ea5, 0x4d60, {0xb0, 0x6c, 0xaf, 0xf3, 0xfd, 0xef, 0x90, 0x8d }}
 
@@ -306,12 +304,12 @@ extern EFI_GUID gConsistencyTestAssertionGuid055;
 { 0x357d40b9, 0xa9b0, 0x4462, {0xa4, 0xc7, 0x40, 0xca, 0x18, 0xcb, 0x17, 0x34 }}
 
 extern EFI_GUID gConsistencyTestAssertionGuid056;
-
+/*
 #define EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID \
 { 0xf4f96d88, 0x1924, 0x4d35, {0x94, 0xc9, 0x7f, 0x7b, 0x6e, 0x42, 0xc2, 0xd4 }}
 
 extern EFI_GUID gConsistencyTestAssertionGuid057;
-
+*/
 #define EFI_TEST_CONSISTENCYTEST_ASSERTION_058_GUID \
 { 0x4f733e46, 0xdacb, 0x4f6f, {0x80, 0x2b, 0x05, 0x45, 0x00, 0x3a, 0x6a, 0x64 }}
 
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c
index 98ce893..ec3637d 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -2487,6 +2487,31 @@ BBTestLocateProtocolConsistencyTest (
                  );
 
   //
+  // Add a checkpoint from the 1559
+  // If Protocol is NULL, then EFI_INVALID_PARAMETER is returned
+  //
+  Status = gtBS->LocateProtocol (
+                   NULL,
+                   NULL,
+                   (VOID **) &TestProtocol2
+                   );
+  if (Status == EFI_INVALID_PARAMETER) {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  }
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gConsistencyTestAssertionGuid009,
+                 L"BS.LocateProtocol - ConsistencyTestCheckpoint4",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  //
   // Checkpoint 2:
   // 3.10.2.2   LocateProtocol should not succeed
   // with a protocol GUID that was never installed
-- 
2.9.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-test][Patch] uefi-sct\SctPkg: Add checkpoint of LocateProtocol()
  2018-10-12  1:52 [edk2-test][Patch] uefi-sct\SctPkg: Add checkpoint of LocateProtocol() Eric Jin
@ 2018-10-12  8:35 ` Supreeth Venkatesh
  0 siblings, 0 replies; 2+ messages in thread
From: Supreeth Venkatesh @ 2018-10-12  8:35 UTC (permalink / raw)
  To: Eric Jin; +Cc: Jiaxin Wu, edk2-devel

Since just migrating over from 
https://github.com/UEFI/UEFI-SCT/commit/f692ed9f6f88e2a03494454f86906e33f543e2d4

Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

Don't forget to use forward slashes in commit message, while committing.

On 10/12/2018 02:52 AM, Eric Jin wrote:
> Clarify return value for NULL pointer in LocateProtocol() API
> When input parameter Protocol is NULL, EFI_INVALID_PARAMETER
> should be returned.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin <eric.jin@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>   .../ProtocolHandlerServices/BlackBoxTest/Guid.c    |  8 +++----
>   .../ProtocolHandlerServices/BlackBoxTest/Guid.h    | 12 ++++------
>   .../ProtocolHandlerBBTestConformance.c             | 27 +++++++++++++++++++++-
>   3 files changed, 35 insertions(+), 12 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c
> index 4069d2f..40927f7 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c
> @@ -1,7 +1,7 @@
>   /** @file
>   
>     Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
>   
>     This program and the accompanying materials
>     are licensed and made available under the terms and conditions of the BSD License
> @@ -44,7 +44,7 @@ EFI_GUID gConsistencyTestAssertionGuid007 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0
>   
>   EFI_GUID gConsistencyTestAssertionGuid008 = EFI_TEST_CONSISTENCYTEST_ASSERTION_008_GUID;
>   
> -//EFI_GUID gConsistencyTestAssertionGuid009 = EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID;
> +EFI_GUID gConsistencyTestAssertionGuid009 = EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID;
>   
>   EFI_GUID gConsistencyTestAssertionGuid010 = EFI_TEST_CONSISTENCYTEST_ASSERTION_010_GUID;
>   
> @@ -70,7 +70,7 @@ EFI_GUID gConsistencyTestAssertionGuid020 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0
>   
>   EFI_GUID gConsistencyTestAssertionGuid021 = EFI_TEST_CONSISTENCYTEST_ASSERTION_021_GUID;
>   
> -EFI_GUID gConsistencyTestAssertionGuid022 = EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID;
> +//EFI_GUID gConsistencyTestAssertionGuid022 = EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID;
>   
>   EFI_GUID gConsistencyTestAssertionGuid023 = EFI_TEST_CONSISTENCYTEST_ASSERTION_023_GUID;
>   
> @@ -140,7 +140,7 @@ EFI_GUID gConsistencyTestAssertionGuid055 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0
>   
>   EFI_GUID gConsistencyTestAssertionGuid056 = EFI_TEST_CONSISTENCYTEST_ASSERTION_056_GUID;
>   
> -EFI_GUID gConsistencyTestAssertionGuid057 = EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID;
> +//EFI_GUID gConsistencyTestAssertionGuid057 = EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID;
>   
>   EFI_GUID gConsistencyTestAssertionGuid058 = EFI_TEST_CONSISTENCYTEST_ASSERTION_058_GUID;
>   
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h
> index 06fbc80..d42d968 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h
> @@ -1,7 +1,7 @@
>   /** @file
>   
>     Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
>   
>     This program and the accompanying materials
>     are licensed and made available under the terms and conditions of the BSD License
> @@ -65,12 +65,10 @@ extern EFI_GUID gConsistencyTestAssertionGuid007;
>   
>   extern EFI_GUID gConsistencyTestAssertionGuid008;
>   
> -/*
>   #define EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID \
>   { 0xe9712c64, 0x302e, 0x4984, {0x9e, 0xc2, 0xb9, 0x91, 0xd3, 0x5e, 0x2e, 0x11 }}
>   
>   extern EFI_GUID gConsistencyTestAssertionGuid009;
> -*/
>   
>   #define EFI_TEST_CONSISTENCYTEST_ASSERTION_010_GUID \
>   { 0xf7c8a812, 0x97c8, 0x4283, {0xa7, 0x79, 0x9c, 0x3a, 0x0d, 0xf9, 0x9b, 0x44 }}
> @@ -131,12 +129,12 @@ extern EFI_GUID gConsistencyTestAssertionGuid020;
>   { 0x0df6b782, 0xbb9c, 0x40e1, {0x99, 0x31, 0xfa, 0x07, 0xce, 0x4e, 0xf3, 0x2d }}
>   
>   extern EFI_GUID gConsistencyTestAssertionGuid021;
> -
> +/*
>   #define EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID \
>   { 0x8508de3d, 0x795d, 0x4833, {0x8c, 0xe2, 0x3c, 0xf9, 0x60, 0x05, 0x50, 0x5b }}
>   
>   extern EFI_GUID gConsistencyTestAssertionGuid022;
> -
> +*/
>   #define EFI_TEST_CONSISTENCYTEST_ASSERTION_023_GUID \
>   { 0x6cad11b3, 0x9ea5, 0x4d60, {0xb0, 0x6c, 0xaf, 0xf3, 0xfd, 0xef, 0x90, 0x8d }}
>   
> @@ -306,12 +304,12 @@ extern EFI_GUID gConsistencyTestAssertionGuid055;
>   { 0x357d40b9, 0xa9b0, 0x4462, {0xa4, 0xc7, 0x40, 0xca, 0x18, 0xcb, 0x17, 0x34 }}
>   
>   extern EFI_GUID gConsistencyTestAssertionGuid056;
> -
> +/*
>   #define EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID \
>   { 0xf4f96d88, 0x1924, 0x4d35, {0x94, 0xc9, 0x7f, 0x7b, 0x6e, 0x42, 0xc2, 0xd4 }}
>   
>   extern EFI_GUID gConsistencyTestAssertionGuid057;
> -
> +*/
>   #define EFI_TEST_CONSISTENCYTEST_ASSERTION_058_GUID \
>   { 0x4f733e46, 0xdacb, 0x4f6f, {0x80, 0x2b, 0x05, 0x45, 0x00, 0x3a, 0x6a, 0x64 }}
>   
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c
> index 98ce893..ec3637d 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c
> @@ -1,7 +1,7 @@
>   /** @file
>   
>     Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
>   
>     This program and the accompanying materials
>     are licensed and made available under the terms and conditions of the BSD License
> @@ -2487,6 +2487,31 @@ BBTestLocateProtocolConsistencyTest (
>                    );
>   
>     //
> +  // Add a checkpoint from the 1559
> +  // If Protocol is NULL, then EFI_INVALID_PARAMETER is returned
> +  //
> +  Status = gtBS->LocateProtocol (
> +                   NULL,
> +                   NULL,
> +                   (VOID **) &TestProtocol2
> +                   );
> +  if (Status == EFI_INVALID_PARAMETER) {
> +    AssertionType = EFI_TEST_ASSERTION_PASSED;
> +  } else {
> +    AssertionType = EFI_TEST_ASSERTION_FAILED;
> +  }
> +  StandardLib->RecordAssertion (
> +                 StandardLib,
> +                 AssertionType,
> +                 gConsistencyTestAssertionGuid009,
> +                 L"BS.LocateProtocol - ConsistencyTestCheckpoint4",
> +                 L"%a:%d:Status - %r",
> +                 __FILE__,
> +                 (UINTN)__LINE__,
> +                 Status
> +                 );
> +
> +  //
>     // Checkpoint 2:
>     // 3.10.2.2   LocateProtocol should not succeed
>     // with a protocol GUID that was never installed



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-12  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-12  1:52 [edk2-test][Patch] uefi-sct\SctPkg: Add checkpoint of LocateProtocol() Eric Jin
2018-10-12  8:35 ` Supreeth Venkatesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox