Bug 1825055 [wpt PR 39247] - Add support for allowing elements with display:contents...
[gecko.git] / nsprpub / pr / tests / op_filnf.c
blobb4ab2fb1569699b18a755b96d3924c78640e7307
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 **
8 ** Name: op_filnf.c
9 **
10 ** Description: Test Program to verify the PR_FILE_NOT_FOUND_ERROR
11 ** This test program also uses the TRUNCATE option
13 ** Modification History:
14 ** 03-June-97 AGarcia- Initial version
15 ***********************************************************************/
17 /***********************************************************************
18 ** Includes
19 ***********************************************************************/
20 /* Used to get the command line option */
21 #include "prinit.h"
22 #include "prmem.h"
23 #include "prio.h"
24 #include "prerror.h"
25 #include <stdio.h>
26 #include "plgetopt.h"
28 static PRFileDesc *t1;
29 PRIntn error_code;
31 int main(int argc, char **argv)
33 PR_STDIO_INIT();
34 t1 = PR_Open("./tmp-ttools/err03.tmp", PR_TRUNCATE | PR_RDWR, 0666);
35 if (t1 == NULL) {
36 if (PR_GetError() == PR_FILE_NOT_FOUND_ERROR) {
37 printf ("error code is %d \n", PR_GetError());
38 printf ("PASS\n");
39 return 0;
41 else {
42 printf ("error code is %d \n", PR_GetError());
43 printf ("FAIL\n");
44 return 1;
47 PR_Close(t1);
48 printf ("opened a file that should not exist\n");
49 printf ("FAIL\n");
50 return 1;