backout 29799f914cab, Bug 917642 - [Helix] Please update the helix blobs
[gecko.git] / nsprpub / pr / tests / op_noacc.c
blob21ad04be46d220bff742e4f62b2c0310b6cc44f3
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_noacc.c
9 **
10 ** Description: Test Program to verify the PR_NO_ACCESS_RIGHTS_ERROR in PR_Open
12 ** Modification History:
13 ** 03-June-97 AGarcia- Initial version
14 ***********************************************************************/
16 /***********************************************************************
17 ** Includes
18 ***********************************************************************/
19 /* Used to get the command line option */
20 #include "prinit.h"
21 #include "prmem.h"
22 #include "prio.h"
23 #include "prerror.h"
24 #include <stdio.h>
25 #include "plgetopt.h"
27 static PRFileDesc *err01;
28 PRIntn error_code;
30 int main(int argc, char **argv)
32 #ifdef XP_PC
33 printf("op_noacc: Test not valid on MS-Windows.\n\tNo concept of 'mode' on Open() call\n");
34 return(0);
35 #endif
38 PR_STDIO_INIT();
39 err01 = PR_Open("err01.tmp", PR_CREATE_FILE | PR_RDWR, 0);
40 if (err01 == NULL) {
41 int error = PR_GetError();
42 printf ("error code is %d\n", error);
43 if (error == PR_NO_ACCESS_RIGHTS_ERROR) {
44 printf ("PASS\n");
45 return 0;
48 printf ("FAIL\n");
49 return 1;