michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /*********************************************************************** michael@0: ** michael@0: ** Name: op_noacc.c michael@0: ** michael@0: ** Description: Test Program to verify the PR_NO_ACCESS_RIGHTS_ERROR in PR_Open michael@0: ** michael@0: ** Modification History: michael@0: ** 03-June-97 AGarcia- Initial version michael@0: ***********************************************************************/ michael@0: michael@0: /*********************************************************************** michael@0: ** Includes michael@0: ***********************************************************************/ michael@0: /* Used to get the command line option */ michael@0: #include "prinit.h" michael@0: #include "prmem.h" michael@0: #include "prio.h" michael@0: #include "prerror.h" michael@0: #include michael@0: #include "plgetopt.h" michael@0: michael@0: static PRFileDesc *err01; michael@0: PRIntn error_code; michael@0: michael@0: int main(int argc, char **argv) michael@0: { michael@0: #ifdef XP_PC michael@0: printf("op_noacc: Test not valid on MS-Windows.\n\tNo concept of 'mode' on Open() call\n"); michael@0: return(0); michael@0: #endif michael@0: michael@0: michael@0: PR_STDIO_INIT(); michael@0: err01 = PR_Open("err01.tmp", PR_CREATE_FILE | PR_RDWR, 0); michael@0: if (err01 == NULL) { michael@0: int error = PR_GetError(); michael@0: printf ("error code is %d\n", error); michael@0: if (error == PR_NO_ACCESS_RIGHTS_ERROR) { michael@0: printf ("PASS\n"); michael@0: return 0; michael@0: } michael@0: } michael@0: printf ("FAIL\n"); michael@0: return 1; michael@0: } michael@0: