1 --- nspr/pr/tests/testfile.c
2 +++ nspr/pr/tests/testfile.c
6 char testdir[TMPDIR_LEN];
7 -static PRInt32 PR_CALLBACK DirTest(void *argunused);
8 +static void PR_CALLBACK DirTest(void *argunused);
9 PRInt32 dirtest_failed = 0;
11 PRThread* create_new_thread(PRThreadType type,
14 #if defined(_PR_PTHREADS)
16 - if (!pthread_create(&tid, NULL, start, arg)) {
17 + if (!pthread_create(&tid, NULL, (void *(*)(void *))start, arg)) {
18 return((PRThread *) tid);
25 -static PRInt32 PR_CALLBACK DirTest(void *arg)
26 +static void PR_CALLBACK DirTest(void *arg)
28 struct dirtest_arg *tinfo = (struct dirtest_arg *) arg;
32 "testfile failed to create dir %s [%d, %d]\n",
33 TEST_DIR, PR_GetError(), PR_GetOSError());
37 fd_dir = PR_OpenDir(TEST_DIR);
40 "testfile failed to open dirctory %s [%d, %d]\n",
41 TEST_DIR, PR_GetError(), PR_GetOSError());
46 strcpy(pathname, TEST_DIR);
49 "testfile failed to create/open file %s [%d, %d]\n",
50 pathname, PR_GetError(), PR_GetOSError());
58 "testfile failed to create/open hidden file %s [%d, %d]\n",
59 pathname, PR_GetError(), PR_GetOSError());
66 if (hfile == INVALID_HANDLE_VALUE) {
67 printf("testfile failed to create/open hidden file %s [0, %d]\n",
68 pathname, GetLastError());
75 if (hfile == INVALID_HANDLE_VALUE) {
76 printf("testfile failed to create/open hidden file %s [0, %d]\n",
77 pathname, GetLastError());
84 if (fd_file == NULL) {
85 printf("testfile failed to create/open hidden file %s [%d, %d]\n",
86 pathname, PR_GetError(), PR_GetOSError());
94 "testfile failed to close dirctory %s [%d, %d]\n",
95 TEST_DIR, PR_GetError(), PR_GetOSError());
99 fd_dir = PR_OpenDir(TEST_DIR);
100 if (fd_dir == NULL) {
102 "testfile failed to reopen dirctory %s [%d, %d]\n",
103 TEST_DIR, PR_GetError(), PR_GetOSError());
109 @@ -750,14 +750,14 @@
111 "testfile failed to GetFileInfo file %s [%d, %d]\n",
112 pathname, PR_GetError(), PR_GetOSError());
117 if (info.type != PR_FILE_FILE) {
119 "testfile incorrect fileinfo for file %s [%d, %d]\n",
120 pathname, PR_GetError(), PR_GetOSError());
128 "testfile failed to find all files in directory %s [%d, %d]\n",
129 TEST_DIR, PR_GetError(), PR_GetOSError());
137 "testfile failed to reopen dirctory %s [%d, %d]\n",
138 TEST_DIR, PR_GetError(), PR_GetOSError());
143 DPRINTF(("Listing non-hidden files in directory %s\n",TEST_DIR));
145 DPRINTF(("\t%s\n",dirEntry->name));
146 if (!strcmp(HIDDEN_FILE_NAME, dirEntry->name)) {
147 printf("testfile found hidden file %s\n", pathname);
155 "testfile failed to delete hidden file %s [%d, %d]\n",
156 pathname, PR_GetError(), PR_GetOSError());
162 @@ -815,41 +815,41 @@
164 "testfile failed to rename directory %s [%d, %d]\n",
165 TEST_DIR, PR_GetError(), PR_GetOSError());
170 if (PR_FAILURE == PR_MkDir(TEST_DIR, 0777)) {
172 "testfile failed to recreate dir %s [%d, %d]\n",
173 TEST_DIR, PR_GetError(), PR_GetOSError());
177 if (PR_SUCCESS == PR_Rename(renamename, TEST_DIR)) {
179 "testfile renamed directory to existing name %s\n",
185 if (PR_FAILURE == PR_RmDir(TEST_DIR)) {
187 "testfile failed to rmdir %s [%d, %d]\n",
188 TEST_DIR, PR_GetError(), PR_GetOSError());
193 if (PR_FAILURE == PR_Rename(renamename, TEST_DIR)) {
195 "testfile failed to rename directory %s [%d, %d]\n",
196 renamename, PR_GetError(), PR_GetOSError());
200 fd_dir = PR_OpenDir(TEST_DIR);
201 if (fd_dir == NULL) {
203 "testfile failed to reopen directory %s [%d, %d]\n",
204 TEST_DIR, PR_GetError(), PR_GetOSError());
209 strcpy(pathname, TEST_DIR);
212 "testfile failed to delete file %s [%d, %d]\n",
213 pathname, PR_GetError(), PR_GetOSError());
219 @@ -875,14 +875,13 @@
221 "testfile failed to rmdir %s [%d, %d]\n",
222 TEST_DIR, PR_GetError(), PR_GetOSError());
226 PR_EnterMonitor(tinfo->mon);
228 PR_Notify(tinfo->mon);
229 PR_ExitMonitor(tinfo->mon);
233 /************************************************************************/