Merge pull request #436 from microsoft/mkoscumb-update-osName-to-align-with-common-schema
Update GetDeviceOsName on Mac and iOS to align with common schema
This commit is contained in:
Коммит
3c5929db08
|
@ -42,12 +42,6 @@ NSString* get_system_value(NSString* key)
|
|||
return @"";
|
||||
}
|
||||
|
||||
std::string GetDeviceOsName()
|
||||
{
|
||||
NSString* value = get_system_value(@"ProductName");
|
||||
return std::string([value UTF8String]);
|
||||
}
|
||||
|
||||
std::string GetDeviceOsVersion()
|
||||
{
|
||||
NSString* value = get_system_value(@"ProductVersion");
|
||||
|
|
|
@ -17,6 +17,11 @@ std::string GetDeviceModel()
|
|||
}
|
||||
}
|
||||
|
||||
std::string GetDeviceOsName()
|
||||
{
|
||||
return std::string("iOS");
|
||||
}
|
||||
|
||||
std::string GetDeviceId()
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
|
|
@ -26,6 +26,11 @@ std::string GetDeviceModel()
|
|||
return deviceModel;
|
||||
}
|
||||
|
||||
std::string GetDeviceOsName()
|
||||
{
|
||||
return std::string("Mac OS X");
|
||||
}
|
||||
|
||||
std::string GetDeviceId()
|
||||
{
|
||||
uuid_t uuidBytes;
|
||||
|
|
|
@ -42,6 +42,14 @@ set(SRCS
|
|||
UtilsTests.cpp
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
if (BUILD_IOS)
|
||||
list(APPEND SRCS SysInfoUtilsTests_iOS.cpp)
|
||||
else()
|
||||
list(APPEND SRCS SysInfoUtilsTests_Mac.cpp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
source_group(" " REGULAR_EXPRESSION "")
|
||||
source_group("common" REGULAR_EXPRESSION "/tests/common/")
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
#include "common/Common.hpp"
|
||||
#include "pal/posix/sysinfo_utils_apple.hpp"
|
||||
|
||||
using namespace testing;
|
||||
using namespace MAT;
|
||||
|
||||
TEST(SysInfoUtilsTests, GetDeviceOsName_Mac_ReturnsMacOsX)
|
||||
{
|
||||
ASSERT_EQ(std::string { "Mac OS X" }, GetDeviceOsName());
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
#include "common/Common.hpp"
|
||||
#include "pal/posix/sysinfo_utils_apple.hpp"
|
||||
|
||||
using namespace testing;
|
||||
using namespace MAT;
|
||||
|
||||
TEST(SysInfoUtilsTests, GetDeviceOsName_iOS_ReturnsiOS)
|
||||
{
|
||||
ASSERT_EQ(std::string { "iOS" }, GetDeviceOsName());
|
||||
}
|
Загрузка…
Ссылка в новой задаче