public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test] [PATCH] Fix missing symbols on edk2-test build
@ 2020-11-11 16:00 Grant Likely
  2020-11-11 20:53 ` Samer El-Haj-Mahmoud
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2020-11-11 16:00 UTC (permalink / raw)
  To: devel
  Cc: nd, Grant Likely, Grant Likely, Samer El-Haj-Mahmoud,
	G Edhaya Chandran, Eric Jin, Barton Gao

EDK2 has removed some deprecated function wrappers. The BlackBoxTest
still uses StrnCpy() and UnicodeValueToString(). This patch fixes the
build by moving to UnicodeValueToStringS(). However, the code using
StrnCpy() is simply #ifdef'd out because on reading the code it is
apparent that the testcase is non-functional and the fix is not
straightforward. As I understand it, there are no functional
implementations of the interface in the wild anyway. If/when it does
become important someone can do the work of making a proper test case.

Fixes: Bug 2068

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
---
 .../Dependency/SampleDriver/DriverSample.c        | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/ConfigKeywordHandler/BlackBoxTest/Dependency/SampleDriver/DriverSample.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/ConfigKeywordHandler/BlackBoxTest/Dependency/SampleDriver/DriverSample.c
index fe973a33..584ee8b4 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/ConfigKeywordHandler/BlackBoxTest/Dependency/SampleDriver/DriverSample.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/ConfigKeywordHandler/BlackBoxTest/Dependency/SampleDriver/DriverSample.c
@@ -920,8 +920,9 @@ ExtractConfig (
 
       BackupChar = Value[ValueStrLen];
       *Value++   = L'=';
-      Value += UnicodeValueToString (
+      Value += UnicodeValueToStringS (
                  Value, 
+                 BufferSize - (Value - *Results),
                  PREFIX_ZERO | RADIX_HEX, 
                  PrivateData->Configuration.NameValueVar0, 
                  sizeof (PrivateData->Configuration.NameValueVar0) * 2
@@ -939,8 +940,9 @@ ExtractConfig (
 
       BackupChar = Value[ValueStrLen];
       *Value++   = L'=';
-      Value += UnicodeValueToString (
+      Value += UnicodeValueToStringS (
                 Value, 
+                BufferSize - (Value - *Results),
                 PREFIX_ZERO | RADIX_HEX, 
                 PrivateData->Configuration.NameValueVar1, 
                 sizeof (PrivateData->Configuration.NameValueVar1) * 2
@@ -962,7 +964,8 @@ ExtractConfig (
       //
       StrPointer = (CHAR16 *) PrivateData->Configuration.NameValueVar2;
       for (; *StrPointer != L'\0'; StrPointer++) {
-        Value += UnicodeValueToString (Value, PREFIX_ZERO | RADIX_HEX, *StrPointer, 4);
+        Value += UnicodeValueToStringS (Value, BufferSize - (Value - *Results),
+                                        PREFIX_ZERO | RADIX_HEX, *StrPointer, 4);
       }
     }
     
@@ -1894,7 +1897,7 @@ DriverSampleInit (
   MY_EFI_VARSTORE_DATA            *VarStoreConfig;
   EFI_INPUT_KEY                   HotKey;
   EDKII_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;
-#if 1
+#if 0
     EFI_STRING                      Progress;
   EFI_STRING                      Results;
   UINT32                          ProgressErr;
@@ -2243,7 +2246,9 @@ DriverSampleInit (
     HiiRemovePackages (HiiHandle[1]);
   }
 
-#if 1
+#if 0 // gcl - This test case is incomplete and fails to compile. StrnCpy needs to be
+      // changed to StrnCpyS() to fix build error, but there is a larger problem that
+      // the testcases don't match the spec or test any behaviour
   //
   // Test Cases 1: Keyword - GetData and change the value by SetData
   //
-- 
2.20.1


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

end of thread, other threads:[~2020-11-24 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-11 16:00 [edk2-test] [PATCH] Fix missing symbols on edk2-test build Grant Likely
2020-11-11 20:53 ` Samer El-Haj-Mahmoud
2020-11-24 10:20   ` [edk2-devel] " G Edhaya Chandran

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