sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * TDIRS.C sl@0: * Test code for directory and file handling sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include "CTEST.H" /* includes C interface to EPOC32 threads, and SpawnPosixServer */ sl@0: sl@0: test_Data; sl@0: int close_console=0; sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-STDLIB-CT-1098 sl@0: @SYMTestCaseDesc Tests for redirection of server sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for running of threads.Check for error codes sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: void tests(void) sl@0: { sl@0: char bob[200]; sl@0: int x; sl@0: printf("calling gets\n"); sl@0: gets (bob); sl@0: printf("got %s\nnow for a getchar > ", bob); sl@0: x = getchar(); sl@0: printf("got %d\n", x); sl@0: scanf("%s", bob); sl@0: printf("got %s\n", bob); sl@0: sl@0: if (close_console) sl@0: { sl@0: test_Close(); sl@0: close(0); sl@0: close(1); sl@0: close(2); sl@0: } sl@0: sl@0: sl@0: } sl@0: sl@0: sl@0: int main() sl@0: { sl@0: void* client; sl@0: int err; sl@0: sl@0: test_Title("Redirection Server"); sl@0: sl@0: start_posix_server(); sl@0: sl@0: close_console=1; sl@0: client=create_thread(tests, "tests"); sl@0: test(client!=0); sl@0: start_thread(client); sl@0: err=wait_for_thread(client); sl@0: sl@0: test(err==0); sl@0: sl@0: test_Close(); sl@0: return 0; sl@0: }