sl@0: // Copyright (c) 2003-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: // sl@0: sl@0: #include sl@0: #include /* definition of exit() */ sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "CTEST.H" sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: sl@0: #define SIZE 10000 sl@0: sl@0: int ReaderPort; sl@0: int WriterPort; sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-STDLIB-CT-1102 sl@0: @SYMTestCaseDesc Tests for serial port sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests by writing a string buffer to the port sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: void Writer() sl@0: { sl@0: char *buffer; sl@0: sl@0: buffer = (char*)malloc(SIZE); sl@0: memset(buffer, '*', SIZE); sl@0: sl@0: printf("\nbig write\n"); sl@0: (void)write(WriterPort, buffer, SIZE); sl@0: (void)errno; sl@0: printf("\n>>Writer<>Writer< 0) sl@0: { sl@0: putchar('.'); sl@0: p += res; sl@0: } sl@0: else sl@0: { sl@0: printf("\nread failed with errno %d\n",errno); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: printf("\n>>Reader<>Reader< 0) sl@0: { sl@0: putchar('.'); sl@0: p += res; sl@0: } sl@0: else sl@0: { sl@0: printf("\nread failed with errno %d\n",errno); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: printf("\n>>Reader<