Name Description Size
.cvsignore 9
abstract.c 3843
accept.c 1996 - Netscape Communications Corporation * * Name: accept.c * * Description: Run accept() sucessful connection tests. * * Modification History: * 04-Jun-97 AGarcia - Reconvert test file to return a 0 for PASS and a 1 for FAIL * 13-May-97 AGarcia- Converted the test to accomodate the debug_mode * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 Revert to return code 0 and 1. ********************************************************************* 16446
acceptread.c PrintAddress 7861
acceptreademu.c This test is the same as acceptread.c except that it uses the emulated acceptread method instead of the regular acceptread. 8951
addrstr.c This is not necessarily an error 2311
affinity.c Test PR_GetThreadAffinityMask The function is called by each of local, global and global bound threads The test should be run on both single and multi-cpu systems 2215
alarm.c 1996 - Netscape Communications Corporation * * Name: alarmtst.c * * Description: Test alarms * * Modification History: * 13-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 13937
anonfm.c File: anonfm.c * Description: Test anonymous file map * * Synopsis: anonfm [options] [dirName] * * Options: * -d enable debug mode * -h display a help message * -s <n> size of the anonymous memory map, in KBytes. default: 100KBytes. * -C 1 Operate this process as ClientOne() * -C 2 Operate this process as ClientTwo() * * anonfn.c contains two tests, corresponding to the two protocols for * passing an anonymous file map to a child process. * * ServerOne()/ClientOne() tests the passing of "raw" file map; it uses * PR_CreateProcess() [for portability of the test case] to create the * child process, but does not use the PRProcessAttr structure for * passing the file map data. * * ServerTwo()/ClientTwo() tests the passing of the file map using the * PRProcessAttr structure. * 8240
append.c File: append.c * Description: Testing File writes where PR_APPEND was used on open * * append attempts to verify that a file opened with PR_APPEND * will always append to the end of file, regardless where the * current file pointer is positioned. To do this, PR_Seek() is * called before each write with the position set to beginning of * file. Subsequent writes should always append. * The file is read back, summing the integer data written to the * file. If the expected result is equal, the test passes. * * See BugSplat: 4090 4474
atomic.c TODO: create a macro to generate the six lines of code that are repeated for every test. Also rewrite the statement result = result | ((EXPRESSION) ? 0 : 1); as result |= !(EXPRESSION); 6282
attach.c 1996 - Netscape Communications Corporation * * Name: attach.c * * Description: Platform-specific code to create a native thread. The native thread will * repeatedly call PR_AttachThread and PR_DetachThread. The * primordial thread waits for this new thread to finish. * * Modification History: * 13-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 Revert to return code 0 and 1. ********************************************************************* 7734
bigfile.c nothing happened 10834
bigfile2.c _WIN32 2722
bigfile3.c _WIN32 2675
bug1test.c Attached is a test program that uses the nspr1 to demonstrate a bug under NT4.0. The fix has already been mentioned (add a ResetEvent just before leaving the critical section in _PR_CondWait in hwmon.c). 6284
cleanup.c Help 3607
cltsrv.c Notes: [1] lth. The call to Sleep() is a hack to get the test case to run on Windows 95. Without it, the test case fails with an error WSAECONNRESET following a recv() call. The error is caused by the server side thread termination without a shutdown() or closesocket() call. Windows docmunentation suggests that this is predicted behavior; that other platforms get away with it is ... serindipity. The test case should shutdown() or closesocket() before thread termination. I didn't have time to figure out where or how to do it. The Sleep() call inserts enough delay to allow the client side to recv() all his data before the server side thread terminates. Whew! ... * Modification History: 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. The debug mode will print all of the printfs associated with this test. The regress mode will be the default mode. Since the regress tool limits the output to a one line status:PASS or FAIL,all of the printf statements have been handled with an if (debug_mode) statement. 41057
concur.c File: concur.c * Description: test of adding and removing concurrency options 4102
cvar.c 1996 - Netscape Communications Corporation * * Name: cvar.c * * Description: Tests Condition Variable Operations * * Modification History: * 13-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 Revert to return code 0 and 1. ********************************************************************* 7571
cvar2.c 1996 - Netscape Communications Corporation * * Name: cvar2.c * * Description: Simple test creates several local and global threads; * half use a single,shared condvar, and the * other half have their own condvar. The main thread then loops * notifying them to wakeup. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 29872
dbmalloc.c Name: dbmalloc.c * * Description: Testing malloc (OBSOLETE) * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 7749
dbmalloc1.c Name: dbmalloc1.c (OBSOLETE) * * Description: Tests PR_SetMallocCountdown PR_ClearMallocCountdown functions. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * * 12-June-97 AGarcia Revert to return code 0 and 1, remove debug option (obsolete). ********************************************************************* 2705
dceemu.c File: dceemu.c * Description: testing the DCE emulation api * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 Revert to return code 0 and 1, remove debug option (obsolete). 2902
depend.c 1996 - Netscape Communications Corporation * * * Name: depend.c * Description: Test to enumerate the dependencies * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 4174
dll
dlltest.c Name: dlltest.c * * Description: test dll functionality. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 Revert to return code 0 and 1. ********************************************************************* 6419
dtoa.c This file contains a test program for the function conversion functions for double precision code: PR_strtod PR_dtoa PR_cnvtf This file was ns/nspr/tests/dtoa.c, created by rrj on 1996/06/22. *************************************************************************** 6318
env.c File: env.c * Description: Testing environment variable operations * 12347
errcodes.c Name: errcodes.c * * Description: print nspr error codes * 6393
errset.c Name: errset.c * * Description: errset.c exercises the functions in prerror.c. * This code is a unit test of the prerror.c capability. * * Note: There's some fluff in here. The guts of the test * were plagerized from another test. So, sue me. * * 7148
exit.c Help 2924
fdcach.c File: fdcach.c Description: This test verifies that the fd cache is working correctly. 3199
fileio.c Name: fileio.c * * Description: Program to copy one file to another. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 Revert to return code 0 and 1, remove debug option (obsolete). ********************************************************************* 5387
foreign.c File: foreign.c * Description: Testing various functions w/ foreign threads * * We create a thread and get it to call exactly one runtime function. * The thread is allowed to be created by some other environment that * NSPR, but it does not announce itself to the runtime prior to calling * in. * * The goal: try to survive. * 9404
forktest.c Name: forktest.c * * Description: UNIX test for fork functions. * * Modification History: * 15-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * 12-June-97 AGarcic - Revert to return code 0 and 1, remove debug option (obsolete). ********************************************************************* 7394
formattm.c A test program for PR_FormatTime and PR_FormatTimeUSEnglish 1522
freeif.c A test to see if the macros PR_DELETE and PR_FREEIF are properly defined. (See Bugzilla bug #39110.) 961
fsync.c Help 3869
getai.c 962
gethost.c File: gethost.c Description: tests various functions in prnetdb.h Usage: gethost [-6] [hostname] 8317
getproto.c File: getproto.c A test program for PR_GetProtoByName and PR_GetProtoByNumber ************************************************************************ 2755
i2l.c Help 2474
initclk.c This is a regression test for the bug that the interval timer is not initialized when _PR_CreateCPU calls PR_IntervalNow. The bug would make this test program finish prematurely, when the SHORT_TIMEOUT period expires. The correct behavior is for the test to finish when the LONG_TIMEOUT period expires. 2320
inrval.c file: inrval.c * description: Interval conversion test. * Modification History: * 15-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. 6969
instrumt.c File: instrumt.c * Description: This test is for the NSPR debug aids defined in * prcountr.h, prtrace.h, prolock.h * * The test case tests the three debug aids in NSPR: * * Diagnostic messages can be enabled using "instrumt -v 6" * This sets the msgLevel to something that PR_LOG() likes. * Also define in the environment "NSPR_LOG_MODULES=Test:6" * * CounterTest() tests the counter facility. This test * creates 4 threads. Each thread either increments, decrements, * adds to or subtracts from a counter, depending on an argument * passed to the thread at thread-create time. Each of these threads * does COUNT_LIMIT iterations doing its thing. When all 4 threads * are done, the result of the counter is evaluated. If all was atomic, * the the value of the counter should be zero. * * TraceTest(): * This test mingles with the counter test. Counters trace. * A thread to extract trace entries on the fly is started. * A thread to dump trace entries to a file is started. * * OrderedLockTest(): * * * * * 13221
intrio.c File: intrio.c Purpose: testing i/o interrupts (see Bugzilla bug #31120) 3900
intrupt.c File: intrupt.c Purpose: testing thread interrupts 9744
io_timeout.c Test socket IO timeouts * * * * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 7366
io_timeoutk.c name io_timeoutk.c * Description:Test socket IO timeouts (kernel level) * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 6135
io_timeoutu.c name io_timeoutu.c * Description: Test socket IO timeouts (user level) * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 6164
ioconthr.c This is a test for the io continuation thread machinery in pthreads. 3668
ipv6.c Help 7238
join.c Name: dbmalloc1.c * * Description: Tests PR_SetMallocCountdown PR_ClearMallocCountdown functions. * * Modification History: * * 19-May-97 AGarcia - separate the four join tests into different unit test modules. * AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 6986
joinkk.c Name: dbmalloc1.c * * Description: Tests PR_SetMallocCountdown PR_ClearMallocCountdown functions. * * Modification History: * * 19-May-97 AGarcia - separate the four join tests into different unit test modules. * AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 4712
joinku.c Name: dbmalloc1.c * * Description: Tests PR_SetMallocCountdown PR_ClearMallocCountdown functions. * * Modification History: * * 19-May-97 AGarcia - separate the four join tests into different unit test modules. * AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 4787
joinuk.c Name: joinuk.c * * Description: Join kernel - user * * Modification History: * * 19-May-97 AGarcia - separate the four join tests into different unit test modules. * AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 4733
joinuu.c Name: dbmalloc1.c * * Description: Join tests user - user * * Modification History: * * 19-May-97 AGarcia - separate the four join tests into different unit test modules. * AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 4739
layer.c Testing layering of I/O * * The layered server * A thread that acts as a server. It creates a TCP listener with a dummy * layer pushed on top. Then listens for incoming connections. Each connection * request for connection will be layered as well, accept one request, echo * it back and close. * * The layered client * Pretty much what you'd expect. 16153
lazyinit.c File: lazyinit.c * Description: Testing lazy initialization * * Since you only get to initialize once, you have to rerun the test * for each test case. The test cases are numbered. If you want to * add more tests, take the next number and add it to the switch * statement. * * This test is problematic on systems that don't support the notion * of console output. The workarounds to emulate that feature include * initializations themselves, which defeats the purpose here. 2715
libfilename.c Name: libfilename.c * * Description: test PR_GetLibraryFilePathname. * ********************************************************************* 2766
lltest.c testll.c -- test suite for 64bit integer (longlong) operations * * Summary: testll [-d] | [-h] * * Where: * -d set debug mode on; displays individual test failures * -v verbose mode; displays progress in test, plus -d * -h gives usage message. * * Description: * lltest.c tests the functions defined in NSPR 2.0's prlong.h. * * Successive tests begin to depend on other LL functions working * correctly. So, ... Do not change the order of the tests as run * from main(). * * Caveats: * Do not even begin to think that this is an exhaustive test! * * These tests try a little of everything, but not all boundary * conditions and limits are tested. * You want better coverage? ... Add it. * * --- * Author: Lawrence Hardiman <larryh@netscape.com>. * --- * Revision History: * 01-Oct-1997. Original implementation. * 26234
lock.c File: lock.c * Purpose: test basic locking functions * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. * * 11-Aug-97 LarryH. Win16 port of NSPR. * - Added "PASS", "FAIL" messages on completion. * - Change stack variables to static scope variables * because of shadow-stack use by Win16 * - Added PR_CALLBACK attribute to functions called by NSPR * - Added command line arguments: * - l <num> to control the number of loops * - c <num> to control the number of CPUs. * (was positional argv). * * ********************************************************************* 16278
lockfile.c File: lockfile.c * Purpose: test basic locking functions * Just because this times stuff, don't think its a perforamnce * test!!! * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 7369
logfile.c A regression test for bug 491441. NSPR should not crash on startup in PR_SetLogFile when the NSPR_LOG_MODULES and NSPR_LOG_FILE environment variables are set. This test could be extended to be a full-blown test for NSPR_LOG_FILE. 1089
logger.c File: logger.c Description: test program for logging's basic functions 3020
makedir.c This test calls PR_MakeDir to create a bunch of directories with various mode bits. 1993
Makefile.in 9409
many_cv.c RandomNum 3283
mbcs.c File: mbcs.c * * Synopsis: mbcs {dirName} * * where dirName is the directory to be traversed. dirName is required. * * Description: * mbcs.c tests use of multi-byte characters, as would be passed to * NSPR funtions by internationalized applications. * * mbcs.c, when run on any single-byte platform, should run correctly. * In truth, running the mbcs test on a single-byte platform is * really meaningless. mbcs.c, nor any NSPR library or test is not * intended for use with any wide character set, including Unicode. * mbcs.c should not be included in runtests.ksh because it requires * extensive user intervention to set-up and run. * * mbcs.c should be run on a platform using some form of multi-byte * characters. The initial platform for this test is a Japanese * language Windows NT 4.0 machine. ... Thank you Noriko Hoshi. * * To run mbcs.c, the tester should create a directory tree containing * some files in the same directory from which the test is run; i.e. * the current working directory. The directory and files should be * named such that when represented in the local multi-byte character * set, one or more characters of the name is longer than a single * byte. * 5139
monref.c This test program demonstrates that PR_ExitMonitor needs to add a reference to the PRMonitor object before unlocking the internal mutex. 1810
multiacc.c File: multiacc.c Description: This test creates multiple threads that accept on the same listening socket. 6781
multiwait.c _MW_Assert 23266
nameshm1.c File: nameshm1.c -- Test Named Shared Memory * * Description: * nameshm1 tests Named Shared Memory. nameshm1 performs two tests of * named shared memory. * * The first test is a basic test. The basic test operates as a single * process. The process exercises all the API elements of the facility. * This test also attempts to write to all locations in the shared * memory. * * The second test is a client-server test. The client-server test * creates a new instance of nameshm1, passing the -C argument to the * new process; this creates the client-side process. The server-side * (the instance of nameshm1 created from the command line) and the * client-side interact via inter-process semaphores to verify that the * shared memory segment can be read and written by both sides in a * synchronized maner. * * Note: Because this test runs in two processes, the log files created * by the test are not in chronological sequence; makes it hard to read. * As a temporary circumvention, I changed the definition(s) of the * _PUT_LOG() macro in prlog.c to force a flushall(), or equivalent. * This causes the log entries to be emitted in true chronological * order. * * Synopsis: nameshm1 [options] [name] * * Options: * -d Enables debug trace via PR_LOG() * -v Enables verbose mode debug trace via PR_LOG() * -w Causes the basic test to attempt to write to the segment * mapped as read-only. When this option is specified, the * test should crash with a seg-fault; this is a destructive * test and is considered successful when it seg-faults. * * -C Causes nameshm1 to start as the client-side of a * client-server pair of processes. Only the instance * of nameshm1 operating as the server-side process should * specify the -C option when creating the client-side process; * the -C option should not be specified at the command line. * The client-side uses the shared memory segment created by * the server-side to communicate with the server-side * process. * * -p <n> Specify the number of iterations the client-server tests * should perform. Default: 1000. * * -s <n> Size, in KBytes (1024), of the shared memory segment. * Default: (10 * 1024) * * -i <n> Number of client-side iterations. Default: 3 * * name specifies the name of the shared memory segment to be used. * Default: /tmp/xxxNSPRshm * * * See also: prshm.h * * /lth. Aug-1999. 17043
nbconn.c A test for nonblocking connect. Functions tested include PR_Connect, PR_Poll, and PR_GetConnectStatus. The test should be invoked with a host name, for example: nbconn www.netscape.com It will do a nonblocking connect to port 80 (HTTP) on that host, and when connected, issue the "GET /" HTTP command. You should run this test in three ways: 1. To a known web site, such as www.netscape.com. The HTML of the top-level page at the web site should be printed. 2. To a machine not running a web server at port 80. This test should fail. Ideally the error code should be PR_CONNECT_REFUSED_ERROR. But it is possible to return PR_UNKNOWN_ERROR on certain platforms. 3. To an unreachable machine, for example, a machine that is off line. The test should fail after the connect times out. Ideally the error code should be PR_IO_TIMEOUT_ERROR, but it is possible to return PR_UNKNOWN_ERROR on certain platforms. 16508
nblayer.c Testing layering of I/O * * The layered server * A thread that acts as a server. It creates a TCP listener with a dummy * layer pushed on top. Then listens for incoming connections. Each connection * request for connection will be layered as well, accept one request, echo * it back and close. * * The layered client * Pretty much what you'd expect. 26275
nonblock.c Make win16 unit_time interval 300 milliseconds, others get 100 6809
ntioto.c File: ntioto.c * Description: * This test, ntioto.c, was designed to reproduce a bug reported by NES * on WindowsNT (fibers implementation). NSPR was asserting in ntio.c * after PR_AcceptRead() had timed out. I/O performed subsequent to the * call to PR_AcceptRead() could complete on a CPU other than the one * on which it was started. The assert in ntio.c detected this, then * asserted. * * Design: * This test will fail with an assert in ntio.c if the problem it was * designed to catch occurs. It returns 0 otherwise. * * The main() thread initializes and tears things down. A file is * opened for writing; this file will be written to by AcceptThread() * and JitterThread(). Main() creates a socket for reading, listens * and binds the socket. * * ConnectThread() connects to the socket created by main, then polls * the "state" variable. When state is AllDone, ConnectThread() exits. * * AcceptThread() calls PR_AcceptRead() on the socket. He fully expects * it to time out. After the timeout, AccpetThread() interacts with * JitterThread() via a common condition variable and the state * variable. The two threads ping-pong back and forth, each thread * writes the the file opened by main. This should provoke the * condition reported by NES (if we didn't fix it). * * The failure is not solid. It may fail within a few ping-pongs between * AcceptThread() and JitterThread() or may take a while. The default * iteration count, jitter, is set by DEFAULT_JITTER. This may be * modified at the command line with the -j option. * 9009
ntoh.c A test program for PR_htons, PR_ntohs, PR_htonl, PR_ntohl, PR_htonll, and PR_ntohll. 2705
obsints.c Test: obsints.c Description: make sure that protypes.h defines the obsolete integer types intn, uintn, uint, int8, uint8, int16, uint16, int32, uint32, int64, and uint64. 1086
op_2long.c Name: op_2long.c * * Description: Test Program to verify the PR_NAME_TOO_LONG_ERROR * * Modification History: * 03-June-97 AGarcia- Initial version ********************************************************************* 1920
op_excl.c Name: op_excl.c * * Description: Test Program to verify function of PR_EXCL open flag * * Modification History: * 27-Oct-1999 lth. Initial version ********************************************************************* 3555
op_filnf.c Name: op_filnf.c * * Description: Test Program to verify the PR_FILE_NOT_FOUND_ERROR * This test program also uses the TRUNCATE option * * Modification History: * 03-June-97 AGarcia- Initial version ********************************************************************* 1602
op_filok.c Name: op_filok.c * * Description: Test Program to verify the PR_Open finding an existing file. * * Modification History: * 03-June-97 AGarcia- Initial version ********************************************************************* 1451
op_noacc.c Name: op_noacc.c * * Description: Test Program to verify the PR_NO_ACCESS_RIGHTS_ERROR in PR_Open * * Modification History: * 03-June-97 AGarcia- Initial version ********************************************************************* 1488
op_nofil.c Name: op_nofil.c * * Description: Test Program to verify the PR_FILE_NOT_FOUND_ERROR * * Modification History: * 03-June-97 AGarcia- Initial version ********************************************************************* 1720
openfile.c This test calls PR_OpenFile to create a bunch of files with various file modes. 3202
parent.c file: parent.c * description: test the process machinery 3380
parsetm.c This test program should eventually become a full-blown test for PR_ParseTimeString. Right now it just verifies that PR_ParseTimeString doesn't crash on an out-of-range time string (bug 480740). 2633
peek.c A test case for the PR_MSG_PEEK flag of PR_Recv(). Test both blocking and non-blocking sockets. 11413
perf.c / static void PR_CALLBACK dull(void *arg) { } static void CDThread(void) { PRInt32 i; int num_threads = count; /* Cannot create too many threads 11707
pipeping.c File: pipeping.c Description: This test runs in conjunction with the pipepong test. This test creates two pipes and redirects the stdin and stdout of the pipepong test to the pipes. Then this test writes "ping" to the pipepong test and the pipepong test writes "pong" back. To run this pair of tests, just invoke pipeping. Tested areas: process creation, pipes, file descriptor inheritance, standard I/O redirection. 4613
pipeping2.c File: pipeping2.c Description: This test runs in conjunction with the pipepong2 test. This test creates two pipes and passes two pipe fd's to the pipepong2 test. Then this test writes "ping" to to the pipepong2 test and the pipepong2 test writes "pong" back. To run this pair of tests, just invoke pipeping2. Tested areas: process creation, pipes, file descriptor inheritance. 4682
pipepong.c File: pipepong.c Description: This test runs in conjunction with the pipeping test. The pipeping test creates two pipes and redirects the stdin and stdout of this test to the pipes. Then the pipeping test writes "ping" to this test and this test writes "pong" back. Note that this test does not depend on NSPR at all. To run this pair of tests, just invoke pipeping. Tested areas: process creation, pipes, file descriptor inheritance, standard I/O redirection. 1814
pipepong2.c File: pipepong2.c Description: This test runs in conjunction with the pipeping2 test. The pipeping2 test creates two pipes and passes two pipe fd's to this test. Then the pipeping2 test writes "ping" to this test and this test writes "pong" back. To run this pair of tests, just invoke pipeping2. Tested areas: process creation, pipes, file descriptor inheritance. 2865
pipeself.c File: pipeself.c Description: This test has two threads communicating with each other using two unidirectional pipes. The primordial thread is the ping thread and the other thread is the pong thread. The ping thread writes "ping" to the pong thread and the pong thread writes "pong" back. 6772
poll_er.c Name: prpoll_err.c * * Description: This program tests PR_Poll with sockets. * error reporting operation is tested * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 6393
poll_nm.c Name: prpoll_norm.c * * Description: This program tests PR_Poll with sockets. * Normal operation are tested * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 11453
poll_to.c Name: prpoll_to.c * * Description: This program tests PR_Poll with sockets. * Timeout operation is tested * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 6086
pollable.c A test for the pollable events. A number of threads are in a ring configuration, each waiting on a pollable event that is set by its upstream neighbor. 8057
prfdbl.c This is a simple test of the PR_fprintf() function for doubles. 896
prftest.c File: prftest.c Description: This is a simple test of the PR_snprintf() function defined in prprf.c. 1630
prftest1.c File: prftest1.c * Description: * This is a simple test of the PR_snprintf() function defined * in prprf.c. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 3584
prftest2.c File: prftest2.c * Description: * This is a simple test of the PR_snprintf() function defined * in prprf.c. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 2994
prfz.c This is a simple test of the PR_fprintf() function for size_t formats. 2323
primblok.c File: primblok.c Purpose: testing whether the primordial thread can block in a native blocking function without affecting the correct functioning of NSPR I/O functions (Bugzilla bug #30746) 3093
priotest.c File: priotest.c Purpose: testing priorities 5711
provider.c Notes: [1] lth. The call to Sleep() is a hack to get the test case to run on Windows 95. Without it, the test case fails with an error WSAECONNRESET following a recv() call. The error is caused by the server side thread termination without a shutdown() or closesocket() call. Windows docmunentation suggests that this is predicted behavior; that other platforms get away with it is ... serindipity. The test case should shutdown() or closesocket() before thread termination. I didn't have time to figure out where or how to do it. The Sleep() call inserts enough delay to allow the client side to recv() all his data before the server side thread terminates. Whew! ... * Modification History: 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. The debug mode will print all of the printfs associated with this test. The regress mode will be the default mode. Since the regress tool limits the output to a one line status:PASS or FAIL,all of the printf statements have been handled with an if (debug_mode) statement. 44293
prpoll.c for close() 11502
prpollml.c This test exercises the code that allocates and frees the syspoll_list array of PRThread in the pthreads version. This test is intended to be run under Purify to verify that there is no memory leak. 4340
prselect.c 1997 - Netscape Communications Corporation * * Name: prselect_err.c * * Description: tests PR_Select with sockets Error condition functions. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 11324
prttools.h Used in Regress Tool 384
pushtop.c A regression test for bug 794316 1981
randseed.c File: rngseed.c * Description: * Test NSPR's Random Number Seed generator * * Initial test: Just make sure it outputs some data. * * ... more? ... check some iterations to ensure it is random (no dupes) * ... more? ... histogram distribution of random numbers 3512
ranfile.c Contact: AOF<freier@netscape.com> * * Name: ranfile.c * * Description: Test to hammer on various components of NSPR * Modification History: * 20-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 14240
README.TXT File: pr/tests/readme 7263
reinit.c This test verifies that NSPR can be cleaned up and reinitialized. 939
rmdir.c File: rmdir.c * Description: Demonstrate bugzilla 80884. * * after fix to unix_errors.c, message should report correct * failure of PR_Rmdir(). * * * 2489
runtests.pl 7834
runtests.sh 5197
runy2ktests.ksh 3604
rwlockrank.c RWLock rank tests 3084
rwlocktest.c RWLock tests Several threads are created to access and modify data arrays using PRRWLocks for synchronization. Two data arrays, array_A and array_B, are initialized with random data and a third array, array_C, is initialized with the sum of the first 2 arrays. Each one of the threads acquires a read lock to verify that the sum of the arrays A and B is equal to array C, and acquires a write lock to consistently update arrays A and B so that their is equal to array C. 5565
sel_spd.c Test the speed of select within NSPR 15194
selct_er.c 1997 - Netscape Communications Corporation * * Name: prselect_err.c * * Description: tests PR_Select with sockets Error condition functions. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 6111
selct_nm.c 1997 - Netscape Communications Corporation * * Name: prselect_norm.c * * Description: tests PR_Select with sockets - Normal operations. * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 9201
selct_to.c 1997 - Netscape Communications Corporation * * Name: prselect_to.c * * Description: tests PR_Select with sockets. Time out functions * * Modification History: * 14-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 5641
select2.c Name: select2.c * * Description: Measure PR_Select and Empty_Select performance. * * Modification History: * 20-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 9797
selintr.c Test whether classic NSPR's select() wrapper properly blocks the periodic SIGALRM clocks. On some platforms (such as HP-UX and SINIX) an interrupted select() system call is restarted with the originally specified timeout, ignoring the time that has elapsed. If a select() call is interrupted repeatedly, it will never time out. (See Bugzilla bug #39674.) 1220
sem.c Name: sem.c * * Description: Tests Semaphonre functions. * * Modification History: * 20-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 5937
sema.c Thread 2 waits on semaphore 2 and posts to semaphore 1. 4767
semaerr.c Help 3534
semaerr1.c Help 3281
semaping.c Help 5745
semapong.c Help 3807
sendzlf.c Test: sendzlf.c Description: send a zero-length file with PR_SendFile and PR_TransmitFile. 6766
server_test.c This server simulates a server running in loopback mode. * * The idea is that a single server is created. The server initially creates * a number of worker threads. Then, with the server running, a number of * clients are created which start requesting service from the server. * * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 18871
servr_kk.c This server simulates a server running in loopback mode. * * The idea is that a single server is created. The server initially creates * a number of worker threads. Then, with the server running, a number of * clients are created which start requesting service from the server. * * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 18099
servr_ku.c This server simulates a server running in loopback mode. * * The idea is that a single server is created. The server initially creates * a number of worker threads. Then, with the server running, a number of * clients are created which start requesting service from the server. * * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 17741
servr_uk.c This server simulates a server running in loopback mode. * * The idea is that a single server is created. The server initially creates * a number of worker threads. Then, with the server running, a number of * clients are created which start requesting service from the server. * * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 17717
servr_uu.c This server simulates a server running in loopback mode. * * The idea is that a single server is created. The server initially creates * a number of worker threads. Then, with the server running, a number of * clients are created which start requesting service from the server. * * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. ********************************************************************* 17739
short_thread.c Create a thread that exits right away; useful for testing race conditions in thread creation 1647
sigpipe.c Test: sigpipe.c Test the SIGPIPE handler in NSPR. This test applies to Unix only. ************************************************************************ 2188
sleep.c defined(XP_UNIX) 2927
socket.c Name: socket.c * * Description: Test socket functionality. * * Modification History: 71781
sockopt.c SO_REUSEPORT 6071
sockping.c File: sockping.c Description: This test runs in conjunction with the sockpong test. This test creates a socket pair and passes one socket to the sockpong test. Then this test writes "ping" to to the sockpong test and the sockpong test writes "pong" back. To run this pair of tests, just invoke sockping. Tested areas: process creation, socket pairs, file descriptor inheritance. 3822
sockpong.c File: sockpong.c Description: This test runs in conjunction with the sockping test. The sockping test creates a socket pair and passes one socket to this test. Then the sockping test writes "ping" to this test and this test writes "pong" back. To run this pair of tests, just invoke sockping. Tested areas: process creation, socket pairs, file descriptor inheritance. 2354
sprintf.c File: sprintf.c Description: This is a test program for the PR_snprintf() functions defined in prprf.c. This test program is based on ns/nspr/tests/sprintf.c, revision 1.10. Modification History: 20-May-1997 AGarcia replaced printf statment to return PASS\n. This is to be used by the regress tool parsing routine. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to recognize the return code from tha main program. 13570
stack.c Test atomic stack operations Two stacks are created and threads add data items (each containing one of the first n integers) to the first stack, remove data items from the first stack and add them to the second stack. The primordial thread compares the sum of the first n integers to the sum of the integers in the data items in the second stack. The test succeeds if they are equal. 8033
stat.c Program to test different ways to get file info; right now it only works for solaris and OS/2. 1829
stdio.c File: stdio.c Description: testing the "special" fds Modification History: 20-May-1997 AGarcia - Replace Test succeeded status with PASS. This is used by the regress tool parsing code. * 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to * recognize the return code from tha main program. 1480
str2addr.c File: str2addr.c Description: a test for PR_StringToNetAddr 1442
strod.c Help 2200
suspend.c secs 4700
switch.c File: switch.c * Description: trying to time context switches 7247
system.c Incr 1616
testbit.c File: lazyinit.c * Description: Test the functions and macros declared in prbit.h * 2400
testfile.c XP_OS2 25833
threads.c Wait for all threads to exit 5178
thrpool_client.c Name: thrpool_client.c * * Description: Test threadpool functionality. * * Modification History: 9815
thrpool_server.c Name: thrpool.c * * Description: Test threadpool functionality. * * Modification History: 15996
thruput.c File: thruput.c * Description: Test server's throughput capability comparing various * implmentation strategies. * * Note: Requires a server machine and an aribitrary number of * clients to bang on it. Trust the numbers on the server * more than those being displayed by the various clients. 12537
time.c Program to test different ways to get the time; right now it is tuned only for solaris. solaris results (100000 iterations): time to get time with time(): 4.63 usec avg, 463 msec total time to get time with gethrtime(): 2.17 usec avg, 217 msec total time to get time with gettimeofday(): 1.25 usec avg, 125 msec total 3892
timemac.c file: timemac.c description: test time and date routines on the Mac 3474
timetest.c file: timetest.c description: test time and date routines 26606
tmoacc.c should be significantly smaller than RAND_MAX 10592
tmocon.c Name: tmocon.c * * Description: test client socket connection. * * Modification History: * 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag. * The debug mode will print all of the printfs associated with this test. * The regress mode will be the default mode. Since the regress tool limits * the output to a one line status:PASS or FAIL,all of the printf statements * have been handled with an if (debug_mode) statement. ********************************************************************* 13682
tpd.c File: tpd.c * Description: Exercising the thread private data bailywick. 7802
udpsrv.c udpsrc.c -- Test basic function of UDP server * * udpsrv operates on the same machine with program udpclt. * udpsrv is the server side of a udp sockets application. * udpclt is the client side of a udp sockets application. * * The test is designed to assist developers in porting/debugging * the UDP socket functions of NSPR. * * This test is not a stress test. * * main() starts two threads: UDP_Server() and UDP_Client(); * main() uses PR_JoinThread() to wait for the threads to complete. * * UDP_Server() does repeated recvfrom()s from a socket. * He detects an EOF condition set by UDP_Client(). For each * packet received by UDP_Server(), he checks its content for * expected content, then sends the packet back to UDP_Client(). * * UDP_Client() sends packets to UDP_Server() using sendto() * he recieves packets back from the server via recvfrom(). * After he sends enough packets containing UDP_AMOUNT_TO_WRITE * bytes of data, he sends an EOF message. * * The test issues a pass/fail message at end. * * Notes: * The variable "_debug_on" can be set to 1 to cause diagnostic * messages related to client/server synchronization. Useful when * the test hangs. * * Error messages are written to stdout. * ******************************************************************* 16510
ut_ttools.h Used in Regress Tool 384
vercheck.c File: vercheck.c Description: This test tests the PR_VersionCheck() function. The compatible_version and incompatible_version arrays need to be updated for each patch or release. Tested areas: library version compatibility check. 3001
version.c fully qualified library name 3144
writev.c USAGE -h dns name of host serving the connection (default = self) -m number of messages to send (default = 100) -s size of each message (default = 100) -f size of each message fragment (default = 100) 7316
xnotify.c LogNow 10895
y2k.c file: y2k.c description: Test for y2k compliance for NSPR. Sep 1999. lth. Added "Sun" specified dates to the test data. 36898
y2ktmo.c Test: y2ktmo Description: This test tests the interval time facilities in NSPR for Y2K compliance. All the functions that take a timeout argument are tested: PR_Sleep, socket I/O (PR_Accept is taken as a representative), PR_Poll, PR_WaitCondVar, PR_Wait, and PR_CWait. A thread of each thread scope (local, global, and global bound) is created to call each of these functions. The test should be started at the specified number of seconds (called the lead time) before a Y2K rollover test date. The timeout values for these threads will span over the rollover date by at least the specified number of seconds. For example, if the lead time is 5 seconds, the test should be started at time (D - 5), where D is a rollover date, and the threads will time out at or after time (D + 5). The timeout values for the threads are spaced one second apart. When a thread times out, it calls PR_IntervalNow() to verify that it did wait for the specified time. In addition, it calls a platform-native function to verify the actual elapsed time again, to rule out the possibility that PR_IntervalNow() is broken. We allow the actual elapsed time to deviate from the specified timeout by a certain tolerance (in milliseconds). 17018
yield.c 1466
zerolen.c Test: zerolen.c Description: a test for Bugzilla bug #17699. We perform the same test for PR_Writev, PR_Write, and PR_Send. In each test the server thread first fills up the connection to the client so that the next write operation will fail with EAGAIN. Then it calls PR_Writev, PR_Write, or PR_Send with a zero-length buffer. The client thread initially does not read so that the connection can be filled up. Then it empties the connection so that the server thread's PR_Writev, PR_Write, or PR_Send call can succeed. Bug #17699 is specific to the pthreads version on Unix, so on other platforms this test does nothing. 7552