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 /***********************************************************************
10 ** Description: Test Program to verify the PR_NAME_TOO_LONG_ERROR
12 ** Modification History:
13 ** 03-June-97 AGarcia- Initial version
14 ***********************************************************************/
16 /***********************************************************************
18 ***********************************************************************/
19 /* Used to get the command line option */
28 static PRFileDesc
*t1
;
32 * should exceed any system's maximum file name length
33 * Note: was set at 4096. This is legal on some unix (Linux 2.1+) platforms.
38 int main(int argc
, char **argv
)
40 char nameTooLong
[TOO_LONG
];
43 /* Generate a really long pathname */
44 for (i
= 0; i
< TOO_LONG
- 1; i
++) {
51 nameTooLong
[TOO_LONG
- 1] = 0;
54 t1
= PR_Open(nameTooLong
, PR_RDWR
, 0666);
56 if (PR_GetError() == PR_NAME_TOO_LONG_ERROR
) {
57 PL_PrintError("error code is");
62 PL_PrintError("error code is");
69 printf ("Test passed\n");