public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kinney, Michael D" <michael.d.kinney@intel.com>
To: edk2-devel@lists.01.org
Cc: Sean Brogan <sean.brogan@microsoft.com>,
	Liming Gao <liming.gao@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: [staging/edk2-test Patch 06/10] MsUnitTestPkg/UnitTestLib: Fix GCC build errors
Date: Tue, 19 Dec 2017 16:00:10 -0800	[thread overview]
Message-ID: <20171220000014.9140-7-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20171220000014.9140-1-michael.d.kinney@intel.com>

Fix typecast of parameter passed to LoadUnitTestCache() to
address a GCC build failure.

Cast pointers passed into UT_ASSERT_EQUAL()  to UINTN.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MsUnitTestPkg/Library/UnitTestLib/UnitTestLib.c            | 2 +-
 MsUnitTestPkg/Sample/SampleUnitTestApp/SampleUnitTestApp.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MsUnitTestPkg/Library/UnitTestLib/UnitTestLib.c b/MsUnitTestPkg/Library/UnitTestLib/UnitTestLib.c
index bc4176d36e..b94e916a87 100644
--- a/MsUnitTestPkg/Library/UnitTestLib/UnitTestLib.c
+++ b/MsUnitTestPkg/Library/UnitTestLib/UnitTestLib.c
@@ -278,7 +278,7 @@ InitUnitTestFramework (
   // If there is a persisted context, load it now.
   if (DoesCacheExist( NewFramework ))
   {
-    Status = LoadUnitTestCache( NewFramework, &(UNIT_TEST_SAVE_HEADER*)(NewFramework->SavedState) );
+    Status = LoadUnitTestCache( NewFramework, (UNIT_TEST_SAVE_HEADER **)(&(NewFramework->SavedState)));
     if (EFI_ERROR( Status ))
     {
       // Don't actually report it as an error, but emit a warning.
diff --git a/MsUnitTestPkg/Sample/SampleUnitTestApp/SampleUnitTestApp.c b/MsUnitTestPkg/Sample/SampleUnitTestApp/SampleUnitTestApp.c
index 7531d13117..73af67a8e4 100644
--- a/MsUnitTestPkg/Sample/SampleUnitTestApp/SampleUnitTestApp.c
+++ b/MsUnitTestPkg/Sample/SampleUnitTestApp/SampleUnitTestApp.c
@@ -62,7 +62,7 @@ MakeSureThatPointerIsNull (
   IN UNIT_TEST_CONTEXT           Context
   )
 {
-  UT_ASSERT_EQUAL(mSampleGlobalTestPointer,          NULL);
+  UT_ASSERT_EQUAL ((UINTN)mSampleGlobalTestPointer, (UINTN)NULL);
   return UNIT_TEST_PASSED;
 } // ListsShouldHaveTheSameDescriptorSize()
 
@@ -131,7 +131,7 @@ GlobalPointerShouldBeChangeable (
   )
 {
   mSampleGlobalTestPointer = (VOID*)-1;
-  UT_ASSERT_EQUAL(mSampleGlobalTestPointer, ((VOID*)-1));
+  UT_ASSERT_EQUAL ((UINTN)mSampleGlobalTestPointer, (UINTN)((VOID *)-1));
   return UNIT_TEST_PASSED;
 } // GlobalPointerShouldBeChangeable()
 
-- 
2.14.2.windows.3



  parent reply	other threads:[~2017-12-19 23:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  0:00 [staging/edk2-test Patch 00/10] MsUnitTestPkg: Add Unit Test Support and sample Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 01/10] " Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 02/10] MsUnitTestPkg: Update copyright and license info Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 03/10] MsUnitTestPkg: Update for VS2017 and 32-bit apps Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 04/10] MsUnitTestPkg/Include: Remove use of variadic macros Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 05/10] MsUnitTestPkg/Library: Use safe string functions Kinney, Michael D
2017-12-20  0:00 ` Kinney, Michael D [this message]
2017-12-20  0:00 ` [staging/edk2-test Patch 07/10] MsUnitTestPkg/Library: Update __FUNCTION__ usage Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 08/10] MsUnitTestPkg: Add missing library classes Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 09/10] MsUnitTestPkg: Add missing DSC file Kinney, Michael D
2017-12-20  0:00 ` [staging/edk2-test Patch 10/10] MsUnitTestPkg: Fix EDK II style issues Kinney, Michael D
2018-01-18  8:10 ` [staging/edk2-test Patch 00/10] MsUnitTestPkg: Add Unit Test Support and sample Sean Brogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171220000014.9140-7-michael.d.kinney@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox