os/ossrv/genericopenlibs/cstdlib/TSTLIB/CTEST.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1997-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 * A small support DLL for STDLIB test programs
    16 * 
    17 *
    18 */
    19 
    20 
    21 
    22 #ifdef __cplusplus
    23 extern "C" {
    24 #endif
    25 #include <_ansi.h>
    26 
    27 /* STDLIB equivalent of RTest
    28  */
    29 
    30 struct __testdata {
    31 	int iCheck;
    32 	int iSubtest;
    33 	int iErrno;
    34 	};
    35 
    36 extern struct __testdata __td;
    37 
    38 IMPORT_C void td_Title(struct __testdata* td, char *title);
    39 IMPORT_C void td_Next(struct __testdata* td, char *testname);
    40 IMPORT_C void td_Test(struct __testdata* td, int line, int mustBeTrue);
    41 IMPORT_C void td_TestErrno(struct __testdata* td, int line, int mustBeTrue, int expectedErrno);
    42 IMPORT_C void td_Close(void);
    43 
    44 #define test_Data		struct __testdata __td	/* declares global variable __td */
    45 
    46 #define test_Title(title)		td_Title(&__td, title)
    47 #define test_Next(testname)		td_Next(&__td, testname)
    48 #define test_Close()			td_Close()
    49 #define test_Test(line,cond)				td_Test(&__td, line, cond)
    50 #define test_TestErrno(line,cond,expected)	td_TestErrno(&__td, line, cond, expected)
    51 
    52 #define test_Start(x)			test_Next(x)
    53 #define test(f)					test_Test(__LINE__, (f)?1:0)
    54 #define test_ok(f)				test_TestErrno(__LINE__, (f)?1:0, errno)
    55 #define test_errno(f,expected)	test_TestErrno(__LINE__, (f)?1:0, expected)
    56 
    57 
    58 /* Routine to ensure that the Comms server is running
    59  */
    60 IMPORT_C int CommInit(int enhanced);
    61 
    62 
    63 /* C routine for starting the redirection server
    64  */
    65 
    66 IMPORT_C int	start_redirection_server(void);
    67 
    68 
    69 /* C routines for creating EPOC32 threads
    70  */
    71 
    72 IMPORT_C int	start_posix_server(void);
    73 
    74 IMPORT_C void*	create_thread(void (*aFn)(), char* aName);
    75 IMPORT_C void	start_thread(void* aThread);
    76 IMPORT_C int	wait_for_thread(void* aThread);
    77 
    78 IMPORT_C void*	create_process(void (*aFn)(), char* aName, char* mode, int fids[3]);
    79 IMPORT_C void	start_process(void* aThread);
    80 IMPORT_C int	wait_for_process(void* aThread);
    81 IMPORT_C int    wait_for_process_id(void* aProcess, int procid, int opt, int* status);
    82 IMPORT_C int 	get_proc_id(void* aProcess);
    83 /* C-callable routines to access the EPOC32 asynchonous ioctl facilities
    84  *
    85  * NB. The int* status parameter stands in for the usual TRequestStatus&
    86  */
    87 IMPORT_C int	async_ioctl(int aFid, int aCmd, void* aParam, int* status);
    88 IMPORT_C int	async_ioctl_completion(int aFid, int aCmd, void* aParam, int* status);
    89 
    90 #ifdef __cplusplus
    91 }
    92 #endif