1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/TSTLIB/TSTDLIBDEFECT.C Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,91 @@
1.4 +/*
1.5 +* Copyright (c) 2004-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 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +#include <stdlib.h> /* definition of exit() */
1.24 +#include <stdio.h>
1.25 +#include <errno.h>
1.26 +#include <string.h>
1.27 +
1.28 +#include <unistd.h> /* for getcwd */
1.29 +#include <sys/fcntl.h> /* for O_RDONLY */
1.30 +#include <sys/types1.h>
1.31 +#include "CTEST.H"
1.32 +
1.33 +test_Data; /* needed for logging */
1.34 +
1.35 +int close_console=0;
1.36 +
1.37 +/**
1.38 +@SYMTestCaseID SYSLIB-STDLIB-CT-1120
1.39 +@SYMTestCaseDesc Tests for defect number 050968
1.40 +@SYMTestPriority High
1.41 +@SYMTestActions Tests for stdlib defect
1.42 +@SYMTestExpectedResults Test must not fail
1.43 +@SYMREQ REQ0000
1.44 +*/
1.45 +void def050968()
1.46 + {
1.47 + unsigned char p = 0xFF;
1.48 +
1.49 + test_Next("Check DEF050968");
1.50 +
1.51 + test(p==0xFF);
1.52 + FD_ZERO(&p);
1.53 + test(p==0);
1.54 + }
1.55 +
1.56 +void doTests()
1.57 + {
1.58 + def050968();
1.59 +
1.60 + if (close_console)
1.61 + {
1.62 + test_Close();
1.63 + close(0);
1.64 + close(1);
1.65 + close(2);
1.66 + }
1.67 + }
1.68 +
1.69 +int main()
1.70 + {
1.71 + void* client;
1.72 + int err;
1.73 +
1.74 + test_Title("TStdlibDefect");
1.75 +
1.76 + doTests();
1.77 +
1.78 + test_Next("Do it again using the CPosixServer (for them, not me)");
1.79 + close_console=1;
1.80 +
1.81 + start_posix_server(); /* calls SpawnPosixServer from C++ code */
1.82 +
1.83 +
1.84 + client=create_thread(doTests, "TSTDLIBDEFECT tests");
1.85 + test(client!=0);
1.86 + start_thread(client);
1.87 + err=wait_for_thread(client);
1.88 + test(err==0);
1.89 +
1.90 + test_Close();
1.91 +
1.92 + return 0;
1.93 + }
1.94 +