1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/TSTLIB/CTEST.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,92 @@
1.4 +/*
1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* A small support DLL for STDLIB test programs
1.19 +*
1.20 +*
1.21 +*/
1.22 +
1.23 +
1.24 +
1.25 +#ifdef __cplusplus
1.26 +extern "C" {
1.27 +#endif
1.28 +#include <_ansi.h>
1.29 +
1.30 +/* STDLIB equivalent of RTest
1.31 + */
1.32 +
1.33 +struct __testdata {
1.34 + int iCheck;
1.35 + int iSubtest;
1.36 + int iErrno;
1.37 + };
1.38 +
1.39 +extern struct __testdata __td;
1.40 +
1.41 +IMPORT_C void td_Title(struct __testdata* td, char *title);
1.42 +IMPORT_C void td_Next(struct __testdata* td, char *testname);
1.43 +IMPORT_C void td_Test(struct __testdata* td, int line, int mustBeTrue);
1.44 +IMPORT_C void td_TestErrno(struct __testdata* td, int line, int mustBeTrue, int expectedErrno);
1.45 +IMPORT_C void td_Close(void);
1.46 +
1.47 +#define test_Data struct __testdata __td /* declares global variable __td */
1.48 +
1.49 +#define test_Title(title) td_Title(&__td, title)
1.50 +#define test_Next(testname) td_Next(&__td, testname)
1.51 +#define test_Close() td_Close()
1.52 +#define test_Test(line,cond) td_Test(&__td, line, cond)
1.53 +#define test_TestErrno(line,cond,expected) td_TestErrno(&__td, line, cond, expected)
1.54 +
1.55 +#define test_Start(x) test_Next(x)
1.56 +#define test(f) test_Test(__LINE__, (f)?1:0)
1.57 +#define test_ok(f) test_TestErrno(__LINE__, (f)?1:0, errno)
1.58 +#define test_errno(f,expected) test_TestErrno(__LINE__, (f)?1:0, expected)
1.59 +
1.60 +
1.61 +/* Routine to ensure that the Comms server is running
1.62 + */
1.63 +IMPORT_C int CommInit(int enhanced);
1.64 +
1.65 +
1.66 +/* C routine for starting the redirection server
1.67 + */
1.68 +
1.69 +IMPORT_C int start_redirection_server(void);
1.70 +
1.71 +
1.72 +/* C routines for creating EPOC32 threads
1.73 + */
1.74 +
1.75 +IMPORT_C int start_posix_server(void);
1.76 +
1.77 +IMPORT_C void* create_thread(void (*aFn)(), char* aName);
1.78 +IMPORT_C void start_thread(void* aThread);
1.79 +IMPORT_C int wait_for_thread(void* aThread);
1.80 +
1.81 +IMPORT_C void* create_process(void (*aFn)(), char* aName, char* mode, int fids[3]);
1.82 +IMPORT_C void start_process(void* aThread);
1.83 +IMPORT_C int wait_for_process(void* aThread);
1.84 +IMPORT_C int wait_for_process_id(void* aProcess, int procid, int opt, int* status);
1.85 +IMPORT_C int get_proc_id(void* aProcess);
1.86 +/* C-callable routines to access the EPOC32 asynchonous ioctl facilities
1.87 + *
1.88 + * NB. The int* status parameter stands in for the usual TRequestStatus&
1.89 + */
1.90 +IMPORT_C int async_ioctl(int aFid, int aCmd, void* aParam, int* status);
1.91 +IMPORT_C int async_ioctl_completion(int aFid, int aCmd, void* aParam, int* status);
1.92 +
1.93 +#ifdef __cplusplus
1.94 +}
1.95 +#endif