author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
/* |
sl@0 | 2 |
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 3 |
* All rights reserved. |
sl@0 | 4 |
* This component and the accompanying materials are made available |
sl@0 | 5 |
* under the terms of "Eclipse Public License v1.0" |
sl@0 | 6 |
* which accompanies this distribution, and is available |
sl@0 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 8 |
* |
sl@0 | 9 |
* Initial Contributors: |
sl@0 | 10 |
* Nokia Corporation - initial contribution. |
sl@0 | 11 |
* |
sl@0 | 12 |
* Contributors: |
sl@0 | 13 |
* |
sl@0 | 14 |
* Description: |
sl@0 | 15 |
* |
sl@0 | 16 |
*/ |
sl@0 | 17 |
|
sl@0 | 18 |
|
sl@0 | 19 |
|
sl@0 | 20 |
#include <stdlib.h> /* definition of exit() */ |
sl@0 | 21 |
#include <stdio.h> |
sl@0 | 22 |
#include <errno.h> |
sl@0 | 23 |
#include <string.h> |
sl@0 | 24 |
|
sl@0 | 25 |
#include <unistd.h> /* for getcwd */ |
sl@0 | 26 |
#include <sys/fcntl.h> /* for O_RDONLY */ |
sl@0 | 27 |
#include <sys/types1.h> |
sl@0 | 28 |
#include "CTEST.H" |
sl@0 | 29 |
|
sl@0 | 30 |
test_Data; /* needed for logging */ |
sl@0 | 31 |
|
sl@0 | 32 |
int close_console=0; |
sl@0 | 33 |
|
sl@0 | 34 |
/** |
sl@0 | 35 |
@SYMTestCaseID SYSLIB-STDLIB-CT-1120 |
sl@0 | 36 |
@SYMTestCaseDesc Tests for defect number 050968 |
sl@0 | 37 |
@SYMTestPriority High |
sl@0 | 38 |
@SYMTestActions Tests for stdlib defect |
sl@0 | 39 |
@SYMTestExpectedResults Test must not fail |
sl@0 | 40 |
@SYMREQ REQ0000 |
sl@0 | 41 |
*/ |
sl@0 | 42 |
void def050968() |
sl@0 | 43 |
{ |
sl@0 | 44 |
unsigned char p = 0xFF; |
sl@0 | 45 |
|
sl@0 | 46 |
test_Next("Check DEF050968"); |
sl@0 | 47 |
|
sl@0 | 48 |
test(p==0xFF); |
sl@0 | 49 |
FD_ZERO(&p); |
sl@0 | 50 |
test(p==0); |
sl@0 | 51 |
} |
sl@0 | 52 |
|
sl@0 | 53 |
void doTests() |
sl@0 | 54 |
{ |
sl@0 | 55 |
def050968(); |
sl@0 | 56 |
|
sl@0 | 57 |
if (close_console) |
sl@0 | 58 |
{ |
sl@0 | 59 |
test_Close(); |
sl@0 | 60 |
close(0); |
sl@0 | 61 |
close(1); |
sl@0 | 62 |
close(2); |
sl@0 | 63 |
} |
sl@0 | 64 |
} |
sl@0 | 65 |
|
sl@0 | 66 |
int main() |
sl@0 | 67 |
{ |
sl@0 | 68 |
void* client; |
sl@0 | 69 |
int err; |
sl@0 | 70 |
|
sl@0 | 71 |
test_Title("TStdlibDefect"); |
sl@0 | 72 |
|
sl@0 | 73 |
doTests(); |
sl@0 | 74 |
|
sl@0 | 75 |
test_Next("Do it again using the CPosixServer (for them, not me)"); |
sl@0 | 76 |
close_console=1; |
sl@0 | 77 |
|
sl@0 | 78 |
start_posix_server(); /* calls SpawnPosixServer from C++ code */ |
sl@0 | 79 |
|
sl@0 | 80 |
|
sl@0 | 81 |
client=create_thread(doTests, "TSTDLIBDEFECT tests"); |
sl@0 | 82 |
test(client!=0); |
sl@0 | 83 |
start_thread(client); |
sl@0 | 84 |
err=wait_for_thread(client); |
sl@0 | 85 |
test(err==0); |
sl@0 | 86 |
|
sl@0 | 87 |
test_Close(); |
sl@0 | 88 |
|
sl@0 | 89 |
return 0; |
sl@0 | 90 |
} |
sl@0 | 91 |