Add support for tvOS in os detection (#88988)
authorMilos Kotlar <kotlarmilos@gmail.com>
Mon, 17 Jul 2023 14:05:35 +0000 (16:05 +0200)
committerGitHub <noreply@github.com>
Mon, 17 Jul 2023 14:05:35 +0000 (16:05 +0200)
src/native/eventpipe/ep-event-source.c
src/tests/tracing/eventpipe/processinfo/processinfo.cs
src/tests/tracing/eventpipe/processinfo2/processinfo2.cs
src/tests/tracing/eventpipe/processinfo3/processinfo3.cs

index 2b1dccc..a605471 100644 (file)
 
 #if defined(HOST_WINDOWS) || defined(HOST_WIN32)
 const ep_char8_t* _ep_os_info = "Windows";
+#elif defined(HOST_TVOS)
+const ep_char8_t* _ep_os_info = "tvOS";
 #elif defined(HOST_IOS)
 const ep_char8_t* _ep_os_info = "iOS";
 #elif defined(HOST_WATCHOS)
 const ep_char8_t* _ep_os_info = "WatchOS";
-#elif defined(HOST_TVOS)
-const ep_char8_t* _ep_os_info = "tvOS";
 #elif defined(__APPLE__)
 const ep_char8_t* _ep_os_info = "macOS";
 #elif defined(HOST_ANDROID)
index 4f0d613..b7b2b48 100644 (file)
@@ -187,10 +187,14 @@ namespace Tracing.Tests.ProcessInfoValidation
             {
                 expectedOSValue = "Android";
             }
-            else if (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS())
+            else if (OperatingSystem.IsIOS())
             {
                 expectedOSValue = "iOS";
             }
+            else if (OperatingSystem.IsTvOS())
+            {
+                expectedOSValue = "tvOS";
+            }
             else
             {
                 expectedOSValue = "Unknown";
index 589af8d..1564c14 100644 (file)
@@ -188,10 +188,14 @@ namespace Tracing.Tests.ProcessInfoValidation
             {
                 expectedOSValue = "Android";
             }
-            else if (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS())
+            else if (OperatingSystem.IsIOS())
             {
                 expectedOSValue = "iOS";
             }
+            else if (OperatingSystem.IsTvOS())
+            {
+                expectedOSValue = "tvOS";
+            }
             else
             {
                 expectedOSValue = "Unknown";
index 5d648e2..a17659f 100644 (file)
@@ -194,10 +194,14 @@ namespace Tracing.Tests.ProcessInfoValidation
             {
                 expectedOSValue = "Android";
             }
-            else if (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS())
+            else if (OperatingSystem.IsIOS())
             {
                 expectedOSValue = "iOS";
             }
+            else if (OperatingSystem.IsTvOS())
+            {
+                expectedOSValue = "tvOS";
+            }
             else
             {
                 expectedOSValue = "Unknown";