mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
17 lines
423 B
C++
17 lines
423 B
C++
#include <gtest/gtest.h>
|
|
#include "getcurrentthreadid.h"
|
|
#include <pthread.h>
|
|
|
|
TEST(GetCurrentThreadId,simple)
|
|
{
|
|
const HANDLE currentThreadId = GetCurrentThreadId();
|
|
const pid_t tid = pthread_self();
|
|
|
|
// first make sure that on this platform those types are of the same size
|
|
ASSERT_TRUE(sizeof(HANDLE) >= sizeof(pid_t));
|
|
|
|
// now compare the actual values
|
|
ASSERT_EQ(currentThreadId,reinterpret_cast<HANDLE>(tid));
|
|
}
|
|
|