os/ossrv/genericopenlibs/posixrealtimeextensions/test/testclock/inc/tclock.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * Name        : tclock.h
    16 * 
    17 *
    18 */
    19 
    20 
    21 
    22 #ifndef __TESTCLOCK_H__
    23 #define __TESTCLOCK_H__
    24 
    25 #include <test/testexecutestepbase.h>
    26 #include <unistd.h>
    27 #include <fcntl.h>
    28 #include <string.h>
    29 #include <stdlib.h>
    30 #include <errno.h>
    31 #include <stdio.h>
    32 #include <signal.h>
    33 #include <spawn.h>
    34 #include <time.h>
    35 #include <sys/wait.h>
    36 #include <sys/stat.h>
    37 #include <sys/mman.h>
    38 
    39 _LIT(KTestgetclockid1, "Testgetclockid1");
    40 _LIT(KTestgetclockid2, "Testgetclockid2");
    41 _LIT(KTestgetclockid3, "Testgetclockid3");
    42 _LIT(KTestgetclockid4, "Testgetclockid4");
    43 _LIT(KTestgetclockid5, "Testgetclockid5");
    44 _LIT(KTestclockresolution1, "Testclockresolution1");
    45 _LIT(KTestclockresolution2, "Testclockresolution2");
    46 _LIT(KTestclockresolution3, "Testclockresolution3");
    47 _LIT(KTestclocknanosleep1, "Testclocknanosleep1");
    48 _LIT(KTestclocknanosleep2, "Testclocknanosleep2");
    49 _LIT(KTestclocknanosleep3, "Testclocknanosleep3");
    50 _LIT(KTestclocknanosleep4, "Testclocknanosleep4");
    51 _LIT(KTestclocknanosleep5, "Testclocknanosleep5");
    52 _LIT(KTestclocknanosleep6, "Testclocknanosleep6");
    53 _LIT(KTestclockgettime1, "Testclockgettime1");
    54 _LIT(KTestclockgettime2, "Testclockgettime2");
    55 _LIT(KTestclockgettime3, "Testclockgettime3");
    56 _LIT(KTestclocksettime1, "Testclocksettime1");
    57 _LIT(KTestclocksettime2, "Testclocksettime2");
    58 _LIT(KTestclocksettime3, "Testclocksettime3");
    59 
    60 enum TMode
    61     {
    62     TREAD = 0x00,
    63     TWRITE
    64     };    
    65     
    66 class CTestclock : public CTestStep
    67 	{
    68 public:
    69 	~CTestclock(); 
    70 	CTestclock(const TDesC& aStepName);
    71 	TVerdict doTestStepL();
    72 	TVerdict doTestStepPreambleL();
    73 	TVerdict doTestStepPostambleL();
    74 protected:  // Functions from base classes
    75 
    76 	static void* ThreadEntryFunctionW(void* arg);
    77 	static void* ThreadEntryFunctionR(void* arg);
    78 	static void* ThreadEntryFunctionWrite(void* arg);
    79 private:
    80 
    81         virtual TInt Testgetclockid1 (  );
    82         virtual TInt Testgetclockid2 (  );
    83         virtual TInt Testgetclockid3 (  );
    84         virtual TInt Testgetclockid4 (  ); 
    85         virtual TInt Testgetclockid5 (  );
    86         virtual TInt Testclockresolution1 (  );  
    87         virtual TInt Testclockresolution2 (  );
    88         virtual TInt Testclockresolution3 (  );
    89         virtual TInt Testclocknanosleep1 (  );
    90         virtual TInt Testclocknanosleep2 (  );
    91         virtual TInt Testclocknanosleep3 (  );
    92         virtual TInt Testclocknanosleep4 (  );
    93         virtual TInt Testclocknanosleep5 (  );
    94         virtual TInt Testclocknanosleep6 (  );
    95         virtual TInt Testclockgettime1 (  );
    96         virtual TInt Testclockgettime2 (  );
    97         virtual TInt Testclockgettime3 (  );  
    98         virtual TInt Testclocksettime1 (  );  
    99         virtual TInt Testclocksettime2 (  );  
   100         virtual TInt Testclocksettime3 (  );  
   101         
   102   private:    // Data
   103 		TInt iParamCnt;
   104         TInt iBlocked;
   105         TInt iThreadId;
   106 
   107 	};
   108 #endif