Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * ANSI C version of the RTest facilities, specifically
19 * As a simplification we don't do the levels of nesting.
28 #include <sys/errno.h>
31 static void failed(struct __testdata* td, int line)
33 printf("Test %d.%d failed, line %d\n", td->iCheck, td->iSubtest, line);
34 printf("Press any key to exit\n");
40 EXPORT_C void td_Title(struct __testdata* td, char *title)
43 printf("%s\n\n", title);
48 EXPORT_C void td_Next(struct __testdata* td, char *testname)
50 printf("%03d: %s\n", ++(td->iCheck), testname);
54 EXPORT_C void td_Test(struct __testdata* td, int line, int mustBeTrue)
62 EXPORT_C void td_TestErrno(struct __testdata* td, int line, int mustBeTrue, int expectedErrno)
68 if (expectedErrno==td->iErrno)
70 printf("Test %d.%d failed, line %d : expected errno = %d, not %d\n",
71 td->iCheck, td->iSubtest, line, expectedErrno, td->iErrno);
76 EXPORT_C void td_Close()
78 printf("\n\nCompleted OK\n");