Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
3bb4ce43
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3bb4ce43
编写于
3月 01, 2021
作者:
J
Jan Kotas
提交者:
GitHub
3月 01, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete low-value PAL test (#48932)
This partially reverts commit
77c939c9
. Fixes #48496
上级
51e25565
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
1 addition
and
140 deletion
+1
-140
src/coreclr/pal/tests/palsuite/CMakeLists.txt
src/coreclr/pal/tests/palsuite/CMakeLists.txt
+1
-8
src/coreclr/pal/tests/palsuite/compilableTests.txt
src/coreclr/pal/tests/palsuite/compilableTests.txt
+0
-2
src/coreclr/pal/tests/palsuite/paltestlist.txt
src/coreclr/pal/tests/palsuite/paltestlist.txt
+0
-1
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.cpp
.../threading/SetThreadDescription/test1/pthread_helpers.cpp
+0
-20
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.hpp
.../threading/SetThreadDescription/test1/pthread_helpers.hpp
+0
-4
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/test1.cpp
...s/palsuite/threading/SetThreadDescription/test1/test1.cpp
+0
-105
未找到文件。
src/coreclr/pal/tests/palsuite/CMakeLists.txt
浏览文件 @
3bb4ce43
...
...
@@ -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
)
...
...
src/coreclr/pal/tests/palsuite/compilableTests.txt
浏览文件 @
3bb4ce43
...
...
@@ -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
...
...
src/coreclr/pal/tests/palsuite/paltestlist.txt
浏览文件 @
3bb4ce43
...
...
@@ -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
...
...
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.cpp
已删除
100644 → 0
浏览文件 @
51e25565
// 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
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.hpp
已删除
100644 → 0
浏览文件 @
51e25565
// 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
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/test1.cpp
已删除
100644 → 0
浏览文件 @
51e25565
// 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
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录