Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
op_2long.c File Reference
#include "prinit.h"
#include "prmem.h"
#include "prio.h"
#include "prerror.h"
#include <stdio.h>
#include "plerror.h"
#include "plgetopt.h"

Go to the source code of this file.

Defines

#define TOO_LONG   5000

Functions

int main (int argc, char **argv)
 The Xalan testcases app.

Variables

static PRFileDesct1
PRIntn error_code

Define Documentation

#define TOO_LONG   5000

Definition at line 74 of file op_2long.c.


Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 76 of file op_2long.c.

{
       char nameTooLong[TOO_LONG];
       int i;

       /* Generate a really long pathname */
       for (i = 0; i < TOO_LONG - 1; i++) {
              if (i % 10 == 0) {
                     nameTooLong[i] = '/';
              } else {
                     nameTooLong[i] = 'a';
              }
       }
       nameTooLong[TOO_LONG - 1] = 0;

#ifdef XP_MAC
       SetupMacPrintfLog("pr_open_re.log");
#endif
       
    PR_STDIO_INIT();
       t1 = PR_Open(nameTooLong, PR_RDWR, 0666);
       if (t1 == NULL) {
              if (PR_GetError() == PR_NAME_TOO_LONG_ERROR) {
            PL_PrintError("error code is");
                     printf ("PASS\n");
                     return 0;
              }
              else {
            PL_PrintError("error code is");
                     printf ("FAIL\n");
                     return 1;
              }
       }
       
              else {
                     printf ("Test passed\n");
                     return 0;
              }
       


}                    

Variable Documentation

PRIntn error_code

Definition at line 67 of file op_2long.c.

PRFileDesc* t1 [static]

Definition at line 66 of file op_2long.c.