From 660e75ce07571b72260d8419c7fbbcc6be719a79 Mon Sep 17 00:00:00 2001 From: Paul Liu Date: Wed, 29 Mar 2017 13:34:05 -0700 Subject: [PATCH] Revert the generic cpp error to HRESULT mapping to E_FAIL. Fix minor te unittest build break. (#118) --- Source/Shared/utils.cpp | 2 +- Tests/UnitTests/Tests/Services/SocialManagerTests.cpp | 4 ++-- Tests/UnitTests/Tests/Shared/LogTests.cpp | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Shared/utils.cpp b/Source/Shared/utils.cpp index 256d5997..222626d5 100644 --- a/Source/Shared/utils.cpp +++ b/Source/Shared/utils.cpp @@ -838,7 +838,7 @@ utils::convert_xbox_live_error_code_to_hresult( case xbox_live_error_code::invalid_config: return __HRESULT_FROM_WIN32(ERROR_BAD_CONFIGURATION); case xbox_live_error_code::unsupported: return E_NOTIMPL; - default: return err; + default: return E_FAIL; } } else if ((err & 0x87DD0000) == 0x87D8000) diff --git a/Tests/UnitTests/Tests/Services/SocialManagerTests.cpp b/Tests/UnitTests/Tests/Services/SocialManagerTests.cpp index 19befe60..878826f6 100644 --- a/Tests/UnitTests/Tests/Services/SocialManagerTests.cpp +++ b/Tests/UnitTests/Tests/Services/SocialManagerTests.cpp @@ -984,7 +984,7 @@ public: RelationshipFilter::Friends ); - VERIFY_ARE_EQUAL(group->Users->Size, USER_LIST.size() - 1); + VERIFY_ARE_EQUAL_UINT(group->Users->Size, USER_LIST.size() - 1); Cleanup(socialManagerInitializationStruct, xboxLiveContext, 1); Cleanup(socialManagerInitializationStruct, xboxLiveContext1); @@ -1558,7 +1558,7 @@ public: VERIFY_IS_TRUE(socialUserGroupLoaded->SocialUserGroup->SocialUserGroupType == SocialUserGroupType::UserListType); VERIFY_ARE_EQUAL_STR_IGNORE_CASE(socialUserGroupLoaded->SocialUserGroup->LocalUser->XboxUserId->Data(), xboxLiveContext->xbox_live_user_id().c_str()); - VERIFY_ARE_EQUAL(vec->Size, socialUserGroupLoaded->SocialUserGroup->UsersTrackedBySocialUserGroup->Size); + VERIFY_ARE_EQUAL_UINT(vec->Size, socialUserGroupLoaded->SocialUserGroup->UsersTrackedBySocialUserGroup->Size); //VERIFY_ARE_EQUAL(vec->Size, socialUserGroupLoaded->SocialUserGroup->Users->Size); for (auto& user : vec) { diff --git a/Tests/UnitTests/Tests/Shared/LogTests.cpp b/Tests/UnitTests/Tests/Shared/LogTests.cpp index 5d355e29..ea644d5e 100644 --- a/Tests/UnitTests/Tests/Shared/LogTests.cpp +++ b/Tests/UnitTests/Tests/Shared/LogTests.cpp @@ -13,6 +13,8 @@ #include "XboxLiveServicesSettings_WinRT.h" using namespace xbox::services::system; +using namespace Microsoft::Xbox::Services; +using namespace Microsoft::Xbox::Services::System; NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN