nsprpub/pr/tests/stdio.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /*
     7  * File:        stdio.c
     8  * Description: testing the "special" fds
     9  * Modification History:
    10  * 20-May-1997 AGarcia - Replace Test succeeded status with PASS. This is used by the
    11  *						regress tool parsing code.
    12  ** 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to
    13 **			recognize the return code from tha main program.
    14  */
    17 #include "prlog.h"
    18 #include "prinit.h"
    19 #include "prio.h"
    21 #include <stdio.h>
    22 #include <string.h>
    24 static PRIntn PR_CALLBACK stdio(PRIntn argc, char **argv)
    25 {
    26     PRInt32 rv;
    28     PRFileDesc *out = PR_GetSpecialFD(PR_StandardOutput);
    29     PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
    31     rv = PR_Write(
    32         out, "This to standard out\n",
    33         strlen("This to standard out\n"));
    34     PR_ASSERT((PRInt32)strlen("This to standard out\n") == rv);
    35     rv = PR_Write(
    36         err, "This to standard err\n",
    37         strlen("This to standard err\n"));
    38     PR_ASSERT((PRInt32)strlen("This to standard err\n") == rv);
    40     return 0;
    42 }  /* stdio */
    44 int main(int argc, char **argv)
    45 {
    46     PR_STDIO_INIT();
    47     return PR_Initialize(stdio, argc, argv, 0);
    48 }  /* main */
    51 /* stdio.c */

mercurial