From e2253d439fb8774cc3fbabdc371edc3ea5792110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= Date: Sat, 6 Aug 2016 14:40:10 +0200 Subject: [PATCH] kernel32/tests: Convert fiber back to thread even when IsThreadAFiber is not available. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernhard Übelacker Signed-off-by: André Hentschel Signed-off-by: Alexandre Julliard --- dlls/kernel32/tests/fiber.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/dlls/kernel32/tests/fiber.c b/dlls/kernel32/tests/fiber.c index 9ff9366c993..7501165dc87 100644 --- a/dlls/kernel32/tests/fiber.c +++ b/dlls/kernel32/tests/fiber.c @@ -155,28 +155,20 @@ static void test_FiberHandling(void) ok(fiberCount == 1, "Wrong fiber count: %d\n", fiberCount); pDeleteFiber(fibers[1]); - if (!pCreateFiberEx) + if (pCreateFiberEx) { - win_skip( "CreateFiberEx not present\n" ); - return; + fibers[1] = pCreateFiberEx(0,0,0,FiberMainProc,&testparam); + ok(fibers[1] != NULL, "CreateFiberEx failed with error %u\n", GetLastError()); + + pSwitchToFiber(fibers[1]); + ok(fiberCount == 2, "Wrong fiber count: %d\n", fiberCount); + pDeleteFiber(fibers[1]); } + else win_skip( "CreateFiberEx not present\n" ); - fibers[1] = pCreateFiberEx(0,0,0,FiberMainProc,&testparam); - ok(fibers[1] != NULL, "CreateFiberEx failed with error %u\n", GetLastError()); - - pSwitchToFiber(fibers[1]); - ok(fiberCount == 2, "Wrong fiber count: %d\n", fiberCount); - pDeleteFiber(fibers[1]); - - if (!pIsThreadAFiber) - { - win_skip( "IsThreadAFiber not present\n" ); - return; - } - - ok(pIsThreadAFiber(), "IsThreadAFiber reported FALSE\n"); + if (pIsThreadAFiber) ok(pIsThreadAFiber(), "IsThreadAFiber reported FALSE\n"); test_ConvertFiberToThread(); - ok(!pIsThreadAFiber(), "IsThreadAFiber reported TRUE\n"); + if (pIsThreadAFiber) ok(!pIsThreadAFiber(), "IsThreadAFiber reported TRUE\n"); } static void test_FiberLocalStorage(void)