diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-06 21:27:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-06 21:27:04 +0200 |
commit | 4a71b30364a4b6d1eaf16fcfdc8e873e6697f293 (patch) | |
tree | a47014077c14579249859ad34afcc5a8f2f0730a /nsprpub/pr/tests | |
parent | d7da72799521386c110dbba73b1e483b00a0a56a (diff) | |
parent | 2dad0ec41d0b69c0a815012e6ea4bdde81b2875b (diff) | |
download | UXP-4a71b30364a4b6d1eaf16fcfdc8e873e6697f293.tar UXP-4a71b30364a4b6d1eaf16fcfdc8e873e6697f293.tar.gz UXP-4a71b30364a4b6d1eaf16fcfdc8e873e6697f293.tar.lz UXP-4a71b30364a4b6d1eaf16fcfdc8e873e6697f293.tar.xz UXP-4a71b30364a4b6d1eaf16fcfdc8e873e6697f293.zip |
Merge branch 'NSS-335'
Diffstat (limited to 'nsprpub/pr/tests')
-rw-r--r-- | nsprpub/pr/tests/Makefile.in | 3 | ||||
-rw-r--r-- | nsprpub/pr/tests/attach.c | 12 | ||||
-rw-r--r-- | nsprpub/pr/tests/dceemu.c | 9 | ||||
-rw-r--r-- | nsprpub/pr/tests/foreign.c | 8 | ||||
-rw-r--r-- | nsprpub/pr/tests/forktest.c | 47 | ||||
-rw-r--r-- | nsprpub/pr/tests/provider.c | 12 | ||||
-rw-r--r-- | nsprpub/pr/tests/socket.c | 6 | ||||
-rw-r--r-- | nsprpub/pr/tests/testfile.c | 6 | ||||
-rw-r--r-- | nsprpub/pr/tests/thrpool_client.c | 2 | ||||
-rw-r--r-- | nsprpub/pr/tests/thrpool_server.c | 2 | ||||
-rw-r--r-- | nsprpub/pr/tests/vercheck.c | 7 |
11 files changed, 23 insertions, 91 deletions
diff --git a/nsprpub/pr/tests/Makefile.in b/nsprpub/pr/tests/Makefile.in index df1f1f2dd..79a67f09c 100644 --- a/nsprpub/pr/tests/Makefile.in +++ b/nsprpub/pr/tests/Makefile.in @@ -373,9 +373,6 @@ endif ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH))) LIBPTHREAD = endif -ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10) -LIBPTHREAD = -ldce -endif endif ifeq ($(OS_TARGET),Android) diff --git a/nsprpub/pr/tests/attach.c b/nsprpub/pr/tests/attach.c index a5daf9d96..a1493b8ec 100644 --- a/nsprpub/pr/tests/attach.c +++ b/nsprpub/pr/tests/attach.c @@ -111,16 +111,6 @@ static int32 threadStartFunc(void *arg) static void * threadStartFunc(void *arg) #endif { -#ifdef _PR_DCETHREADS - { - int rv; - pthread_t self = pthread_self(); - rv = pthread_detach(&self); - if (debug_mode) PR_ASSERT(0 == rv); - else if (0 != rv) failed_already=1; - } -#endif - Measure(AttachDetach, "Attach/Detach"); #ifndef IRIX @@ -206,14 +196,12 @@ int main(int argc, char **argv) goto exit_now; } -#ifndef _PR_DCETHREADS rv = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); if (debug_mode) PR_ASSERT(0 == rv); else if (0 != rv) { failed_already=1; goto exit_now; } -#endif /* !_PR_DCETHREADS */ rv = _PT_PTHREAD_CREATE(&threadID, attr, threadStartFunc, NULL); if (rv != 0) { fprintf(stderr, "thread creation failed: error code %d\n", rv); diff --git a/nsprpub/pr/tests/dceemu.c b/nsprpub/pr/tests/dceemu.c index b06b49e3a..99fd6cb7c 100644 --- a/nsprpub/pr/tests/dceemu.c +++ b/nsprpub/pr/tests/dceemu.c @@ -29,8 +29,6 @@ #include <stdio.h> #include <stdlib.h> -#if defined(_PR_DCETHREADS) - PRIntn failed_already=0; PRIntn debug_mode=0; @@ -80,20 +78,13 @@ static PRIntn prmain(PRIntn argc, char **argv) } /* prmain */ -#endif /* #if defined(_PR_DCETHREADS) */ - int main(int argc, char **argv) { - -#if defined(_PR_DCETHREADS) PR_Initialize(prmain, argc, argv, 0); if(failed_already) return 1; else return 0; -#else - return 0; -#endif } /* main */ diff --git a/nsprpub/pr/tests/foreign.c b/nsprpub/pr/tests/foreign.c index 637f419d1..cfb2e56ef 100644 --- a/nsprpub/pr/tests/foreign.c +++ b/nsprpub/pr/tests/foreign.c @@ -52,7 +52,7 @@ static int _debug_on = 0; #define DPRINTF(arg) if (_debug_on) PR_fprintf arg -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) #include <pthread.h> #include "md/_pth.h" static void *pthread_start(void *arg) @@ -63,7 +63,7 @@ static void *pthread_start(void *arg) start(data); return NULL; } /* pthread_start */ -#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */ +#endif /* defined(_PR_PTHREADS) */ #if defined(IRIX) && !defined(_PR_PTHREADS) #include <sys/types.h> @@ -109,7 +109,7 @@ static PRStatus NSPRPUB_TESTS_CreateThread(StartFn start, void *arg) } break; case thread_pthread: -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) { int rv; pthread_t id; @@ -137,7 +137,7 @@ static PRStatus NSPRPUB_TESTS_CreateThread(StartFn start, void *arg) PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); rv = PR_FAILURE; break; -#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */ +#endif /* defined(_PR_PTHREADS) */ case thread_sproc: #if defined(IRIX) && !defined(_PR_PTHREADS) diff --git a/nsprpub/pr/tests/forktest.c b/nsprpub/pr/tests/forktest.c index a389fa479..66dc64575 100644 --- a/nsprpub/pr/tests/forktest.c +++ b/nsprpub/pr/tests/forktest.c @@ -196,51 +196,6 @@ finish: return; } -#ifdef _PR_DCETHREADS - -#include <syscall.h> - -pid_t PR_UnixFork1(void) -{ - pid_t parent = getpid(); - int rv = syscall(SYS_fork); - - if (rv == -1) { - return (pid_t) -1; - } else { - /* For each process, rv is the pid of the other process */ - if (rv == parent) { - /* the child */ - return 0; - } else { - /* the parent */ - return rv; - } - } -} - -#elif defined(SOLARIS) - -/* - * It seems like that in Solaris 2.4 one must call fork1() if the - * the child process is going to use thread functions. Solaris 2.5 - * doesn't have this problem. Calling fork() also works. - */ - -pid_t PR_UnixFork1(void) -{ - return fork1(); -} - -#else - -pid_t PR_UnixFork1(void) -{ - return fork(); -} - -#endif /* PR_DCETHREADS */ - int main(int argc, char **argv) { pid_t pid; @@ -250,7 +205,7 @@ int main(int argc, char **argv) DoIO(); - pid = PR_UnixFork1(); + pid = fork(); if (pid == (pid_t) -1) { fprintf(stderr, "Fork failed: errno %d\n", errno); diff --git a/nsprpub/pr/tests/provider.c b/nsprpub/pr/tests/provider.c index 0e6569d66..932241ec3 100644 --- a/nsprpub/pr/tests/provider.c +++ b/nsprpub/pr/tests/provider.c @@ -606,7 +606,7 @@ typedef struct StartObject void *arg; } StartObject; -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) #include "md/_pth.h" #include <pthread.h> @@ -619,7 +619,7 @@ static void *pthread_start(void *arg) start(data); return NULL; } /* pthread_start */ -#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */ +#endif /* defined(_PR_PTHREADS) */ #if defined(IRIX) && !defined(_PR_PTHREADS) #include <sys/types.h> @@ -657,10 +657,10 @@ static PRStatus JoinThread(PRThread *thread) rv = PR_JoinThread(thread); break; case thread_pthread: -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) rv = PR_SUCCESS; break; -#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */ +#endif /* defined(_PR_PTHREADS) */ case thread_win32: #if defined(WIN32) rv = PR_SUCCESS; @@ -690,7 +690,7 @@ static PRStatus NewThread( } break; case thread_pthread: -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) { int rv; pthread_t id; @@ -717,7 +717,7 @@ static PRStatus NewThread( #else PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); rv = PR_FAILURE; -#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */ +#endif /* defined(_PR_PTHREADS) */ break; case thread_sproc: diff --git a/nsprpub/pr/tests/socket.c b/nsprpub/pr/tests/socket.c index 5ee2b78f3..92f019d01 100644 --- a/nsprpub/pr/tests/socket.c +++ b/nsprpub/pr/tests/socket.c @@ -21,7 +21,7 @@ #ifdef XP_UNIX #include <sys/mman.h> #endif -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) #include <pthread.h> #endif @@ -313,7 +313,7 @@ PRThread* create_new_thread(PRThreadType type, PRInt32 native_thread = 0; PR_ASSERT(state == PR_UNJOINABLE_THREAD); -#if (defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)) || defined(WIN32) +#if defined(_PR_PTHREADS) || defined(WIN32) switch(index % 4) { case 0: scope = (PR_LOCAL_THREAD); @@ -332,7 +332,7 @@ PRInt32 native_thread = 0; break; } if (native_thread) { -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) pthread_t tid; if (!pthread_create(&tid, NULL, (void * (*)(void *)) start, arg)) return((PRThread *) tid); diff --git a/nsprpub/pr/tests/testfile.c b/nsprpub/pr/tests/testfile.c index 23659876e..1191bfe94 100644 --- a/nsprpub/pr/tests/testfile.c +++ b/nsprpub/pr/tests/testfile.c @@ -13,7 +13,7 @@ #include <windows.h> #include <process.h> #endif -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) #include <pthread.h> #endif #ifdef SYMBIAN @@ -104,7 +104,7 @@ PRInt32 native_thread = 0; PR_ASSERT(state == PR_UNJOINABLE_THREAD); -#if (defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)) || defined(WIN32) || defined(XP_OS2) +#if defined(_PR_PTHREADS) || defined(WIN32) || defined(XP_OS2) switch(index % 4) { case 0: @@ -124,7 +124,7 @@ PRInt32 native_thread = 0; break; } if (native_thread) { -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) pthread_t tid; if (!pthread_create(&tid, NULL, start, arg)) return((PRThread *) tid); diff --git a/nsprpub/pr/tests/thrpool_client.c b/nsprpub/pr/tests/thrpool_client.c index a0e1e4c24..7f3df3271 100644 --- a/nsprpub/pr/tests/thrpool_client.c +++ b/nsprpub/pr/tests/thrpool_client.c @@ -21,7 +21,7 @@ #ifdef XP_UNIX #include <sys/mman.h> #endif -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) #include <pthread.h> #endif diff --git a/nsprpub/pr/tests/thrpool_server.c b/nsprpub/pr/tests/thrpool_server.c index 9665829a1..ef09f23b5 100644 --- a/nsprpub/pr/tests/thrpool_server.c +++ b/nsprpub/pr/tests/thrpool_server.c @@ -21,7 +21,7 @@ #ifdef XP_UNIX #include <sys/mman.h> #endif -#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) +#if defined(_PR_PTHREADS) #include <pthread.h> #endif diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index 6170125de..da2f7b1de 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -39,7 +39,8 @@ static char *compatible_version[] = { "4.9.6", "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4", "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9", - "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15" + "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15", + "4.16", "4.17", PR_VERSION }; @@ -55,8 +56,8 @@ static char *incompatible_version[] = { "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.16.1", - "4.17", "4.17.1", + "4.18.1", + "4.19", "4.19.1", "10.0", "11.1", "12.14.20" }; |