nsprpub/pr/tests/op_noacc.c

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     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
    11 **
    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)
    31 {
    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;
    46         }
    47     }
    48     printf ("FAIL\n");
    49     return 1;
    50 }

mercurial