Module: wine Branch: master Commit: 846636274fa1180c9f5ef6580e4bf8beaa0c14b2 URL: https://gitlab.winehq.org/wine/wine/-/commit/846636274fa1180c9f5ef6580e4bf8b...
Author: Piotr Caban piotr@codeweavers.com Date: Fri Aug 25 19:21:11 2023 +0200
msvcr120/tests: Add Context::IsCurrentTaskCollectionCanceling tests.
---
dlls/msvcr120/tests/msvcr120.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index d21e73244c2..672be695c3d 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -251,6 +251,7 @@ static void (__thiscall *p__Condition_variable_notify_all)(_Condition_variable*)
static Context* (__cdecl *p_Context_CurrentContext)(void); static _Context* (__cdecl *p__Context__CurrentContext)(_Context*); +static MSVCRT_bool (__cdecl *p_Context_IsCurrentTaskCollectionCanceling)(void);
static _StructuredTaskCollection* (__thiscall *p__StructuredTaskCollection_ctor)(_StructuredTaskCollection*, void*); static void (__thiscall *p__StructuredTaskCollection_dtor)(_StructuredTaskCollection*); @@ -317,6 +318,7 @@ static BOOL init(void) SET(p__Context__CurrentContext, "?_CurrentContext@_Context@details@Concurrency@@SA?AV123@XZ"); SET(p_strcmp, "strcmp"); SET(p_strncmp, "strncmp"); + SET(p_Context_IsCurrentTaskCollectionCanceling, "?IsCurrentTaskCollectionCanceling@Context@Concurrency@@SA_NXZ"); if(sizeof(void*) == 8) { /* 64-bit initialization */ SET(p__StructuredTaskCollection_ctor, "??0_StructuredTaskCollection@details@Concurrency@@QEAA@PEAV_CancellationTokenState@12@@Z"); @@ -1409,6 +1411,9 @@ static void __cdecl chore_proc(_UnrealizedChore *_this) chore->chore.task_collection); ok(!canceling, "Task is already canceling\n");
+ ok(!p_Context_IsCurrentTaskCollectionCanceling(), + "IsCurrentTaskCollectionCanceling returned TRUE\n"); + call_func1(p__Cancellation_beacon_ctor, &beacon); ok(!*beacon.cancelling, "beacon signalled %x\n", *beacon.cancelling);
@@ -1440,6 +1445,9 @@ static void __cdecl chore_proc(_UnrealizedChore *_this) chore->chore.task_collection); ok(canceling, "Task is not canceling\n");
+ ok(p_Context_IsCurrentTaskCollectionCanceling(), + "IsCurrentTaskCollectionCanceling returned FALSE\n"); + ok(*beacon.cancelling == 1, "beacon not signalled (%x)\n", *beacon.cancelling); call_func1(p__Cancellation_beacon_dtor, &beacon); ok(*beacon2.cancelling == 1, "beacon not signalled (%x)\n", *beacon2.cancelling); @@ -1622,10 +1630,14 @@ static void test_StructuredTaskCollection(void) ret = WaitForSingleObject(chore_evt1, 5000); ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", ret);
+ ok(!p_Context_IsCurrentTaskCollectionCanceling(), + "IsCurrentTaskCollectionCanceling returned TRUE\n"); call_func1(p__Cancellation_beacon_ctor, &beacon); ok(!*beacon.cancelling, "beacon signalled\n");
call_func1(p__StructuredTaskCollection__Cancel, &task_coll); + ok(!p_Context_IsCurrentTaskCollectionCanceling(), + "IsCurrentTaskCollectionCanceling returned TRUE\n"); ok(!*beacon.cancelling, "beacon signalled\n");
b = SetEvent(chore_evt2);