diff options
author | Jan Kotas <jkotas@microsoft.com> | 2021-03-02 07:15:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 07:15:30 +0300 |
commit | 3bb4ce433df67749295e8e77defde7aef5e75c6d (patch) | |
tree | 9235883276f5dc75b60710052dbf5c78a1c0b43f /src/coreclr/pal | |
parent | 51e2556523777142a0e63f21387fa2d39d6e3361 (diff) |
Delete low-value PAL test (#48932)
This partially reverts commit 77c939c9c9acfc49fcb7dc695ff33d03ca06f99e.
Fixes #48496
Diffstat (limited to 'src/coreclr/pal')
6 files changed, 1 insertions, 140 deletions
diff --git a/src/coreclr/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/pal/tests/palsuite/CMakeLists.txt index 5666a1716b6..f59e6f43f96 100644 --- a/src/coreclr/pal/tests/palsuite/CMakeLists.txt +++ b/src/coreclr/pal/tests/palsuite/CMakeLists.txt @@ -32,13 +32,6 @@ if(FEATURE_EVENT_TRACE) add_subdirectory(eventprovider) endif(FEATURE_EVENT_TRACE) -if (CLR_CMAKE_TARGET_OSX OR (CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_ALPINE_LINUX)) - set(PALSUITE_THREAD_NAME_SOURCES - threading/SetThreadDescription/test1/pthread_helpers.cpp - threading/SetThreadDescription/test1/test1.cpp - ) - endif() - _add_executable(paltests paltests.cpp common/palsuite.cpp @@ -925,7 +918,7 @@ _add_executable(paltests threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.cpp threading/YieldProcessor/test1/test1.cpp - ${PALSUITE_THREAD_NAME_SOURCES} + ) add_dependencies(paltests coreclrpal) diff --git a/src/coreclr/pal/tests/palsuite/compilableTests.txt b/src/coreclr/pal/tests/palsuite/compilableTests.txt index d9b38171322..c674de294db 100644 --- a/src/coreclr/pal/tests/palsuite/compilableTests.txt +++ b/src/coreclr/pal/tests/palsuite/compilableTests.txt @@ -772,13 +772,11 @@ threading/ResetEvent/test2/paltest_resetevent_test2 threading/ResetEvent/test3/paltest_resetevent_test3 threading/ResetEvent/test4/paltest_resetevent_test4 threading/ResumeThread/test1/paltest_resumethread_test1 -threading/SwitchToThread/test1/paltest_switchtothread_test1 threading/SetErrorMode/test1/paltest_seterrormode_test1 threading/SetEvent/test1/paltest_setevent_test1 threading/SetEvent/test2/paltest_setevent_test2 threading/SetEvent/test3/paltest_setevent_test3 threading/SetEvent/test4/paltest_setevent_test4 -threading/SetThreadDescription/test1/paltest_setthreaddescription_test1 threading/SignalObjectAndWait/paltest_signalobjectandwaittest threading/Sleep/test1/paltest_sleep_test1 threading/Sleep/test2/paltest_sleep_test2 diff --git a/src/coreclr/pal/tests/palsuite/paltestlist.txt b/src/coreclr/pal/tests/palsuite/paltestlist.txt index ab3e851b99e..2b9ac7ccd4e 100644 --- a/src/coreclr/pal/tests/palsuite/paltestlist.txt +++ b/src/coreclr/pal/tests/palsuite/paltestlist.txt @@ -679,7 +679,6 @@ threading/SetEvent/test1/paltest_setevent_test1 threading/SetEvent/test2/paltest_setevent_test2 threading/SetEvent/test3/paltest_setevent_test3 threading/SetEvent/test4/paltest_setevent_test4 -threading/SetThreadDescription/test1/paltest_setthreaddescription_test1 threading/SwitchToThread/test1/paltest_switchtothread_test1 threading/ThreadPriority/test1/paltest_threadpriority_test1 threading/WaitForMultipleObjects/test1/paltest_waitformultipleobjects_test1 diff --git a/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.cpp b/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.cpp deleted file mode 100644 index 39601406019..00000000000 --- a/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include <stdlib.h> -#include <pthread.h> - -#define NAMELEN 256 -char* GetThreadName() -{ - char* threadName = (char*)malloc(sizeof(char) * NAMELEN); - pthread_t thread = pthread_self(); - int rc = pthread_getname_np(thread, threadName, NAMELEN); - if (rc != 0) - { - free(threadName); - return NULL; - } - - return threadName; -}
\ No newline at end of file diff --git a/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.hpp b/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.hpp deleted file mode 100644 index b2bfdc2ee26..00000000000 --- a/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.hpp +++ /dev/null @@ -1,4 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -char* GetThreadName();
\ No newline at end of file diff --git a/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/test1.cpp deleted file mode 100644 index 391c0b1db60..00000000000 --- a/src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/test1.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test1.cpp -** -** Purpose: Test for SetThreadDescription. Create a thread, call -** SetThreadDescription, and then verify that the name of the thread -** matches what was set. -** -**=========================================================*/ - -#include <palsuite.h> -#include "pthread_helpers.hpp" - -char * threadName; -char * expectedThreadName; -char * actualThreadName; - -DWORD PALAPI SetThreadDescriptionTestThread(LPVOID lpParameter) -{ - HANDLE palThread = GetCurrentThread(); - WCHAR wideThreadName[256]; - - MultiByteToWideChar(CP_ACP, 0, threadName, strlen(threadName)+1, wideThreadName, 256); - SetThreadDescription(palThread, wideThreadName); - actualThreadName = GetThreadName(); - - return 0; -} - -BOOL SetThreadDescriptionTest(char* name, char* expected) -{ - BOOL bResult = FALSE; - LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL; - DWORD dwStackSize = 0; - LPTHREAD_START_ROUTINE lpStartAddress = &SetThreadDescriptionTestThread; - LPVOID lpParameter = (LPVOID)SetThreadDescriptionTestThread; - DWORD dwCreationFlags = 0; - DWORD dwThreadId = 0; - - threadName = name; - expectedThreadName = expected; - - HANDLE hThread = CreateThread(lpThreadAttributes, - dwStackSize, lpStartAddress, lpParameter, - dwCreationFlags, &dwThreadId ); - - if (hThread != INVALID_HANDLE_VALUE) - { - WaitForSingleObject(hThread, INFINITE); - bResult = strcmp(actualThreadName, expectedThreadName) == 0; - } - else - { - Trace("Unable to create SetThreadDescription test thread"); - } - - return bResult; -} - -BOOL SetThreadDescriptionTests() -{ - if (!SetThreadDescriptionTest("Hello, World", "Hello, World")) - { - Trace("Setting thread name failed"); - return FAIL; - } - - // verify that thread name truncations works correctly on linux on macOS. - char * threadName = "aaaaaaa_15chars_aaaaaaa_31chars_aaaaaaaaaaaaaaaaaaaaaaa_63chars_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - char * expected; - #if defined(__APPLE__) - expected = "aaaaaaa_15chars_aaaaaaa_31chars_aaaaaaaaaaaaaaaaaaaaaaa_63chars"; - #else - expected = "aaaaaaa_15chars"; - #endif - - if (!SetThreadDescriptionTest(threadName, expected)) - { - return PASS; - } - - return FAIL; -} - -PALTEST(threading_SetThreadDescription_test1_paltest_setthreaddescription_test1, "threading/SetThreadDescription/test1/paltest_setthreaddescription_test1") -{ - if (0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - BOOL result = SetThreadDescriptionTests(); - if(actualThreadName) free(actualThreadName); - if (!result) - { - Fail("Test Failed"); - } - - PAL_Terminate(); - return PASS; -} - |