diff -r 000000000000 -r bde4ae8d615e os/ossrv/genericopenlibs/cstdlib/TSTLIB/tser3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/genericopenlibs/cstdlib/TSTLIB/tser3.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,211 @@ +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include /* definition of exit() */ +#include +#include +#include +#include +#include +#include "CTEST.H" + +#ifdef __cplusplus +extern "C" { +#endif + + +#define SIZE 10000 + +int ReaderPort; +int WriterPort; + +/** +@SYMTestCaseID SYSLIB-STDLIB-CT-1102 +@SYMTestCaseDesc Tests for serial port +@SYMTestPriority High +@SYMTestActions Tests by writing a string buffer to the port +@SYMTestExpectedResults Test must not fail +@SYMREQ REQ0000 +*/ +void Writer() + { + char *buffer; + + buffer = (char*)malloc(SIZE); + memset(buffer, '*', SIZE); + + printf("\nbig write\n"); + (void)write(WriterPort, buffer, SIZE); + (void)errno; + printf("\n>>Writer<>Writer< 0) + { + putchar('.'); + p += res; + } + else + { + printf("\nread failed with errno %d\n",errno); + break; + } + } + + printf("\n>>Reader<>Reader< 0) + { + putchar('.'); + p += res; + } + else + { + printf("\nread failed with errno %d\n",errno); + break; + } + } + + printf("\n>>Reader<