Changeset 9b20126 in mainline for uspace/lib/pcut/tests/timeout.c


Ignore:
Timestamp:
2014-09-19T08:23:01Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c85a57f
Parents:
15d0046
Message:

Update PCUT to newest version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/tests/timeout.c

    r15d0046 r9b20126  
    2828
    2929#include <pcut/pcut.h>
     30
     31#ifdef __unix
    3032#include <unistd.h>
     33#endif
     34#if defined(__WIN64) || defined(__WIN32) || defined(_WIN32)
     35#include <windows.h>
     36#endif
     37
    3138#include <stdio.h>
    3239#include "tested.h"
     40
     41static void my_sleep(int sec) {
     42#ifdef __unix
     43        sleep(sec);
     44#endif
     45#if defined(__WIN64) || defined(__WIN32) || defined(_WIN32)
     46        Sleep(1000 * sec);
     47#endif
     48}
    3349
    3450PCUT_INIT
     
    3652PCUT_TEST(shall_time_out) {
    3753        printf("Text before sleeping.\n");
    38         sleep(PCUT_DEFAULT_TEST_TIMEOUT * 5);
     54        my_sleep(PCUT_DEFAULT_TEST_TIMEOUT * 5);
    3955        printf("Text after the sleep.\n");
    4056}
     
    4359                PCUT_TEST_SET_TIMEOUT(PCUT_DEFAULT_TEST_TIMEOUT * 3)) {
    4460        printf("Text before sleeping.\n");
    45         sleep(PCUT_DEFAULT_TEST_TIMEOUT * 2);
     61        my_sleep(PCUT_DEFAULT_TEST_TIMEOUT * 2);
    4662        printf("Text after the sleep.\n");
    4763}
Note: See TracChangeset for help on using the changeset viewer.