Bug 1845715 - Check for failure when getting RegExp match result template r=iain
[gecko.git] / nsprpub / pr / tests / stdio.c
blobd8a12389b24828699f1221b6b17e85f6e66b3d1e
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.
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)
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)
46 PR_STDIO_INIT();
47 return PR_Initialize(stdio, argc, argv, 0);
48 } /* main */
51 /* stdio.c */