diff options
author | wtc%netscape.com <devnull@localhost> | 1999-03-19 22:47:21 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1999-03-19 22:47:21 +0000 |
commit | 134b812cd0408ee7e3da0605be02c6772f522665 (patch) | |
tree | 067938c224ecf70615c6daeb0a98208a11005a8f | |
parent | 10aeceda59f5431f5a43a2fd12f390f2149a1055 (diff) | |
download | nspr-hg-134b812cd0408ee7e3da0605be02c6772f522665.tar.gz |
Update from the internal CVS repository /m/src. Includes: first
cut at 64-bit AIX port.
-rw-r--r-- | config/AIX.mk | 12 | ||||
-rw-r--r-- | lib/ds/plevent.h | 14 | ||||
-rw-r--r-- | pr/include/md/Makefile | 6 | ||||
-rw-r--r-- | pr/include/md/_aix32.cfg (renamed from pr/include/md/_aix.cfg) | 0 | ||||
-rw-r--r-- | pr/include/md/_aix64.cfg | 122 | ||||
-rw-r--r-- | pr/include/md/_unixos.h | 13 | ||||
-rw-r--r-- | pr/src/io/prfdcach.c | 6 | ||||
-rw-r--r-- | pr/src/io/prlayer.c | 52 | ||||
-rw-r--r-- | pr/src/md/unix/aix.c | 4 | ||||
-rw-r--r-- | pr/src/md/unix/unix.c | 4 | ||||
-rw-r--r-- | pr/src/pthreads/ptio.c | 43 | ||||
-rw-r--r-- | pr/tests/y2k.c | 28 |
12 files changed, 248 insertions, 56 deletions
diff --git a/config/AIX.mk b/config/AIX.mk index 79f20536..3346c2e7 100644 --- a/config/AIX.mk +++ b/config/AIX.mk @@ -65,6 +65,13 @@ CC = xlC_r CCC = xlC_r endif OS_CFLAGS = -qro -qroconst +ifeq ($(USE_64),1) +OBJECT_MODE = 64 +export OBJECT_MODE +COMPILER_TAG = _64 +else +COMPILER_TAG = _32 +endif CPU_ARCH = rs6000 @@ -101,6 +108,11 @@ OS_CFLAGS += -DAIX4_3 endif endif +# Have the socklen_t data type +ifeq ($(OS_RELEASE),4.3) +OS_CFLAGS += -DHAVE_SOCKLEN_T +endif + ifeq (,$(filter-out 4.2 4.3,$(OS_RELEASE))) # On these OS revisions, localtime_r() is declared if _THREAD_SAFE # is defined. diff --git a/lib/ds/plevent.h b/lib/ds/plevent.h index 7330a8d9..ef5e93c0 100644 --- a/lib/ds/plevent.h +++ b/lib/ds/plevent.h @@ -439,12 +439,6 @@ PL_DestroyEvent(PLEvent* self); PR_EXTERN(void) PL_DequeueEvent(PLEvent* self, PLEventQueue* queue); -#if defined(_WIN32) || defined(WIN16) || defined(XP_OS2) -PR_EXTERN(HWND) -PR_GetEventReceiverWindow(); -#endif - - /******************************************************************************* * Private Stuff ******************************************************************************/ @@ -465,14 +459,6 @@ struct PLEvent { ** */ #ifdef XP_PC -PR_EXTERN(PLEventQueue *) - PL_GetMainEventQueue(void); -/* -** Initializes the main event queue. -*/ -PR_EXTERN(void) - PL_InitializeEventsLib(char *name); - /* ----------------------------------------------------------------------- ** FUNCTION: PL_GetNativeEventReceiverWindow() ** diff --git a/pr/include/md/Makefile b/pr/include/md/Makefile index cd91bc5e..bd09c078 100644 --- a/pr/include/md/Makefile +++ b/pr/include/md/Makefile @@ -48,7 +48,11 @@ endif endif ifeq ($(OS_ARCH),AIX) -MDCPUCFG_H = _aix.cfg +ifeq ($(USE_64),1) +MDCPUCFG_H = _aix64.cfg +else +MDCPUCFG_H = _aix32.cfg +endif endif ifeq ($(OS_ARCH),BSD_OS) diff --git a/pr/include/md/_aix.cfg b/pr/include/md/_aix32.cfg index a8d26d89..a8d26d89 100644 --- a/pr/include/md/_aix.cfg +++ b/pr/include/md/_aix32.cfg diff --git a/pr/include/md/_aix64.cfg b/pr/include/md/_aix64.cfg new file mode 100644 index 00000000..475ef046 --- /dev/null +++ b/pr/include/md/_aix64.cfg @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#ifndef nspr_cpucfg___ +#define nspr_cpucfg___ + +#ifndef XP_UNIX +#define XP_UNIX +#endif + +#ifndef AIX +#define AIX +#endif + +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 4 +#define PR_ALIGN_OF_POINTER 8 + +#define HAVE_LONG_LONG +#undef HAVE_ALIGNED_DOUBLES +#undef HAVE_ALIGNED_LONGLONGS + +#ifndef NO_NSPR_10_SUPPORT + +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT +#define BYTES_PER_INT PR_BYTES_PER_INT +#define BYTES_PER_INT64 PR_BYTES_PER_INT64 +#define BYTES_PER_LONG PR_BYTES_PER_LONG +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE +#define BYTES_PER_WORD PR_BYTES_PER_WORD +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD + +#define BITS_PER_BYTE PR_BITS_PER_BYTE +#define BITS_PER_SHORT PR_BITS_PER_SHORT +#define BITS_PER_INT PR_BITS_PER_INT +#define BITS_PER_INT64 PR_BITS_PER_INT64 +#define BITS_PER_LONG PR_BITS_PER_LONG +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE +#define BITS_PER_WORD PR_BITS_PER_WORD + +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 + +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT +#define ALIGN_OF_INT PR_ALIGN_OF_INT +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD + +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 + +#endif /* NO_NSPR_10_SUPPORT */ + +#endif /* nspr_cpucfg___ */ diff --git a/pr/include/md/_unixos.h b/pr/include/md/_unixos.h index cd564f41..b6eac162 100644 --- a/pr/include/md/_unixos.h +++ b/pr/include/md/_unixos.h @@ -551,11 +551,17 @@ struct stat64 { long st_pad4[8]; }; typedef struct stat64 _MDStat64; +typedef off64_t _MDOff64_t; #elif defined(_PR_HAVE_OFF64_T) typedef struct stat64 _MDStat64; -#elif defined(_PR_HAVE_LARGE_OFF_T) || defined(_PR_NO_LARGE_FILES) +typedef off64_t _MDOff64_t; +#elif defined(_PR_HAVE_LARGE_OFF_T) typedef struct stat _MDStat64; +typedef off_t _MDOff64_t; +#elif defined(_PR_NO_LARGE_FILES) +typedef struct stat _MDStat64; +typedef PRInt64 _MDOff64_t; #else #error "I don't know yet" #endif @@ -563,11 +569,10 @@ typedef struct stat _MDStat64; typedef PRIntn (*_MD_Fstat64)(PRIntn osfd, _MDStat64 *buf); typedef PRIntn (*_MD_Open64)(const char *path, int oflag, ...); typedef PRIntn (*_MD_Stat64)(const char *path, _MDStat64 *buf); -typedef PRInt64 (*_MD_Lseek64)(PRIntn osfd, PRInt64, PRIntn whence); -typedef PRIntn (*_MD_Lockf64)(PRIntn osfd, PRIntn function, PRInt64 size); +typedef _MDOff64_t (*_MD_Lseek64)(PRIntn osfd, _MDOff64_t, PRIntn whence); typedef void* (*_MD_Mmap64)( void *addr, PRSize len, PRIntn prot, PRIntn flags, - PRIntn fildes, PRInt64 offset); + PRIntn fildes, _MDOff64_t offset); struct _MD_IOVector { _MD_Open64 _open64; diff --git a/pr/src/io/prfdcach.c b/pr/src/io/prfdcach.c index 9c7c8ea7..081448d1 100644 --- a/pr/src/io/prfdcach.c +++ b/pr/src/io/prfdcach.c @@ -103,6 +103,8 @@ PRFileDesc *_PR_Getfd() PR_ASSERT(0 == _pr_fd_cache.count); _pr_fd_cache.tail = NULL; } + PR_ASSERT(&_pr_faulty_methods == fd->methods); + PR_ASSERT(PR_INVALID_IO_LAYER == fd->identity); PR_ASSERT(_PR_FILEDESC_FREED == fd->secret->state); } PR_Unlock(_pr_fd_cache.ml); @@ -244,8 +246,8 @@ void _PR_InitFdCache() if (NULL != high) _pr_fd_cache.limit_high = atoi(high); /* - **_low is allowed to be zero, _high is not. - ** IF _high is zero, we're not doing the caching. + ** _low is allowed to be zero, _high is not. + ** If _high is zero, we're not doing the caching. */ #if defined(DEBUG) diff --git a/pr/src/io/prlayer.c b/pr/src/io/prlayer.c index 34d1b5ad..4e13ed41 100644 --- a/pr/src/io/prlayer.c +++ b/pr/src/io/prlayer.c @@ -154,23 +154,30 @@ static PRFileDesc* PR_CALLBACK pl_TopAccept ( { PRStatus rv; PRFileDesc *newfd; + PRFileDesc *newstack; PR_ASSERT(fd != NULL); PR_ASSERT(fd->lower != NULL); + newstack = PR_NEW(PRFileDesc); + if (NULL == newstack) + { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + return NULL; + } + *newstack = *fd; /* make a copy of the accepting layer */ + newfd = (fd->lower->methods->accept)(fd->lower, addr, timeout); - if (newfd != NULL) + if (NULL == newfd) { - PRFileDesc *newstack = PR_NEW(PRFileDesc); - if (NULL != newstack) - { - *newstack = *fd; /* make a copy of the accepting layer */ - rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack); - if (PR_SUCCESS == rv) return newfd; /* that's it */ - } - PR_Close(newfd); /* we failed for local reasons */ + PR_DELETE(newstack); + return NULL; } - return NULL; + + /* this PR_PushIOLayer call cannot fail */ + rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack); + PR_ASSERT(PR_SUCCESS == rv); + return newfd; /* that's it */ } static PRStatus PR_CALLBACK pl_DefBind (PRFileDesc *fd, const PRNetAddr *addr) @@ -253,10 +260,33 @@ static PRInt32 PR_CALLBACK pl_DefAcceptread ( PRFileDesc *sd, PRFileDesc **nd, PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime t) { + PRInt32 nbytes; + PRStatus rv; + PRFileDesc *newstack; + PR_ASSERT(sd != NULL); PR_ASSERT(sd->lower != NULL); - return sd->lower->methods->acceptread(sd->lower, nd, raddr, buf, amount, t); + newstack = PR_NEW(PRFileDesc); + if (NULL == newstack) + { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + return -1; + } + *newstack = *sd; /* make a copy of the accepting layer */ + + nbytes = sd->lower->methods->acceptread( + sd->lower, nd, raddr, buf, amount, t); + if (-1 == nbytes) + { + PR_DELETE(newstack); + return nbytes; + } + + /* this PR_PushIOLayer call cannot fail */ + rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack); + PR_ASSERT(PR_SUCCESS == rv); + return nbytes; } static PRInt32 PR_CALLBACK pl_DefTransmitfile ( diff --git a/pr/src/md/unix/aix.c b/pr/src/md/unix/aix.c index d7d260e2..b209bbe3 100644 --- a/pr/src/md/unix/aix.c +++ b/pr/src/md/unix/aix.c @@ -265,6 +265,8 @@ PR_StackPush(PRStack *stack, PRStackElem *stack_elem) PRStackElem *addr; boolean_t locked = TRUE; + /* Is it safe to cast a pointer to an int? */ + PR_ASSERT(sizeof(int) == sizeof(PRStackElem *)); do { while ((addr = stack->prstk_head.prstk_elem_next) == (PRStackElem *)_PR_AIX_ATOMIC_LOCK) @@ -283,6 +285,8 @@ PR_StackPop(PRStack *stack) PRStackElem *element; boolean_t locked = TRUE; + /* Is it safe to cast a pointer to an int? */ + PR_ASSERT(sizeof(int) == sizeof(PRStackElem *)); do { while ((element = stack->prstk_head.prstk_elem_next) == (PRStackElem *) _PR_AIX_ATOMIC_LOCK) diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c index 95648e7b..04a34731 100644 --- a/pr/src/md/unix/unix.c +++ b/pr/src/md/unix/unix.c @@ -42,7 +42,9 @@ * Make sure _PRSockLen_t is 32-bit, because we will cast a PRUint32* or * PRInt32* pointer to a _PRSockLen_t* pointer. */ -#if defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \ +#if defined(HAVE_SOCKLEN_T) +#define _PRSockLen_t socklen_t +#elif defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \ || defined(AIX4_1) || defined(LINUX) || defined(SONY) \ || defined(BSDI) || defined(SCO) || defined(NEC) || defined(SNI) \ || defined(SUNOS4) || defined(NCR) || defined(RHAPSODY) \ diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c index 2be13937..b57ecea6 100644 --- a/pr/src/pthreads/ptio.c +++ b/pr/src/pthreads/ptio.c @@ -196,7 +196,8 @@ static PRBool IsValidNetAddrLen(const PRNetAddr *addr, PRInt32 addr_len) * Latest POSIX defines this type as socklen_t. It may also be * size_t or int. */ -#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2 \ +#if defined(HAVE_SOCKLEN_T) \ + || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2 \ && !defined(__alpha)) typedef socklen_t pt_SockLen; #elif (defined(AIX) && !defined(AIX4_1)) \ @@ -1004,9 +1005,13 @@ static PRBool pt_send_cont(pt_Continuation *op, PRInt16 revents) op->arg3.amount -= bytes; /* and reduce the required count */ return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE; } - else return ((-1 == bytes) && - (EWOULDBLOCK == op->syserrno || EAGAIN == op->syserrno)) ? - PR_FALSE : PR_TRUE; + else if ((-1 == bytes) && (EWOULDBLOCK != op->syserrno) + && (EAGAIN != op->syserrno)) + { + op->result.code = -1; + return PR_TRUE; + } + else return PR_FALSE; } /* pt_send_cont */ static PRBool pt_write_cont(pt_Continuation *op, PRInt16 revents) @@ -1030,9 +1035,13 @@ static PRBool pt_write_cont(pt_Continuation *op, PRInt16 revents) op->arg3.amount -= bytes; /* and reduce the required count */ return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE; } - else return ((-1 == bytes) && - (EWOULDBLOCK == op->syserrno || EAGAIN == op->syserrno)) ? - PR_FALSE : PR_TRUE; + else if ((-1 == bytes) && (EWOULDBLOCK != op->syserrno) + && (EAGAIN != op->syserrno)) + { + op->result.code = -1; + return PR_TRUE; + } + else return PR_FALSE; } /* pt_write_cont */ static PRBool pt_writev_cont(pt_Continuation *op, PRInt16 revents) @@ -1069,9 +1078,13 @@ static PRBool pt_writev_cont(pt_Continuation *op, PRInt16 revents) op->arg3.amount -= iov_index; /* and array length */ return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE; } - else return ((-1 == bytes) && - (EWOULDBLOCK == op->syserrno || EAGAIN == op->syserrno)) ? - PR_FALSE : PR_TRUE; + else if ((-1 == bytes) && (EWOULDBLOCK != op->syserrno) + && (EAGAIN != op->syserrno)) + { + op->result.code = -1; + return PR_TRUE; + } + else return PR_FALSE; } /* pt_writev_cont */ static PRBool pt_sendto_cont(pt_Continuation *op, PRInt16 revents) @@ -1089,9 +1102,13 @@ static PRBool pt_sendto_cont(pt_Continuation *op, PRInt16 revents) op->arg3.amount -= bytes; /* and reduce the required count */ return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE; } - else return ((-1 == bytes) && - (EWOULDBLOCK == op->syserrno || EAGAIN == op->syserrno)) ? - PR_FALSE : PR_TRUE; + else if ((-1 == bytes) && (EWOULDBLOCK != op->syserrno) + && (EAGAIN != op->syserrno)) + { + op->result.code = -1; + return PR_TRUE; + } + else return PR_FALSE; } /* pt_sendto_cont */ static PRBool pt_recvfrom_cont(pt_Continuation *op, PRInt16 revents) diff --git a/pr/tests/y2k.c b/pr/tests/y2k.c index 72acfc7a..7aaff5f3 100644 --- a/pr/tests/y2k.c +++ b/pr/tests/y2k.c @@ -482,6 +482,7 @@ static ParseTest parseArray[] = { /* |<----- expected result ------------------------------------------->| */ /* "string to test" usec sec min hour day mo year wday julian {gmtoff, dstoff }*/ + { "Thursday 1 Jan 1970 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, { "1 Jan 1970 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, { "1-Jan-1970 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, { "01-Jan-1970 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, @@ -498,13 +499,18 @@ static ParseTest parseArray[] = { "70/1/1 00:00:", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, { "00:00 Thursday, January 1, 1970",{ 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, { "1-Jan-70 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, + { "70-01-01 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, + { "70/01/01 00:00:00", { 000000, 00, 00, 00, 1, 0, 1970, 4, 0, {-28800, 0 }}}, /* 31-Dec-1969 */ + { "Wed 31 Dec 1969 00:00:00", { 000000, 00, 00, 00, 31, 11, 1969, 3, 364, {-28800, 0 }}}, { "31 Dec 1969 00:00:00", { 000000, 00, 00, 00, 31, 11, 1969, 3, 364, {-28800, 0 }}}, { "12/31/69 00:00:00", { 000000, 00, 00, 00, 31, 11, 2069, 2, 364, {-28800, 0 }}}, { "12/31/1969 00:00:00", { 000000, 00, 00, 00, 31, 11, 1969, 3, 364, {-28800, 0 }}}, { "12-31-69 00:00:00", { 000000, 00, 00, 00, 31, 11, 2069, 2, 364, {-28800, 0 }}}, { "12-31-1969 00:00:00", { 000000, 00, 00, 00, 31, 11, 1969, 3, 364, {-28800, 0 }}}, + { "69-12-31 00:00:00", { 000000, 00, 00, 00, 31, 11, 2069, 2, 364, {-28800, 0 }}}, + { "69/12/31 00:00:00", { 000000, 00, 00, 00, 31, 11, 2069, 2, 364, {-28800, 0 }}}, /* 31-Dec-1999 */ { "31 Dec 1999 00:00:00", { 000000, 00, 00, 00, 31, 11, 1999, 5, 364, {-28800, 0 }}}, @@ -512,6 +518,8 @@ static ParseTest parseArray[] = { "12/31/1999 00:00:00", { 000000, 00, 00, 00, 31, 11, 1999, 5, 364, {-28800, 0 }}}, { "12-31-99 00:00:00", { 000000, 00, 00, 00, 31, 11, 1999, 5, 364, {-28800, 0 }}}, { "12-31-1999 00:00:00", { 000000, 00, 00, 00, 31, 11, 1999, 5, 364, {-28800, 0 }}}, + { "99-12-31 00:00:00", { 000000, 00, 00, 00, 31, 11, 1999, 5, 364, {-28800, 0 }}}, + { "99/12/31 00:00:00", { 000000, 00, 00, 00, 31, 11, 1999, 5, 364, {-28800, 0 }}}, /* 01-Jan-2000 */ { "01 Jan 2000 00:00:00", { 000000, 00, 00, 00, 1, 0, 2000, 6, 0, {-28800, 0 }}}, @@ -520,7 +528,7 @@ static ParseTest parseArray[] = { "1-1-00 00:00:00", { 000000, 00, 00, 00, 1, 0, 2000, 6, 0, {-28800, 0 }}}, { "1-1-2000 00:00:00", { 000000, 00, 00, 00, 1, 0, 2000, 6, 0, {-28800, 0 }}}, { "01-01-00 00:00:00", { 000000, 00, 00, 00, 1, 0, 2000, 6, 0, {-28800, 0 }}}, - { "01-01-2000 00:00:00", { 000000, 00, 00, 00, 1, 0, 2000, 6, 0, {-28800, 0 }}}, + { "Saturday 01-01-2000 00:00:00", { 000000, 00, 00, 00, 1, 0, 2000, 6, 0, {-28800, 0 }}}, /* 29-Feb-2000 */ { "29 Feb 2000 00:00:00", { 000000, 00, 00, 00, 29, 1, 2000, 2, 59, {-28800, 0 }}}, @@ -581,6 +589,7 @@ static ParseTest parseArray[] = { "9-9-1999 00:00:00", { 000000, 00, 00, 00, 9, 8, 1999, 4, 251, {-28800, 3600 }}}, { "09-09-99 00:00:00", { 000000, 00, 00, 00, 9, 8, 1999, 4, 251, {-28800, 3600 }}}, { "09-09-1999 00:00:00", { 000000, 00, 00, 00, 9, 8, 1999, 4, 251, {-28800, 3600 }}}, + { "99-09-09 00:00:00", { 000000, 00, 00, 00, 9, 8, 1999, 4, 251, {-28800, 3600 }}}, /* last element. string must be null */ { NULL } @@ -614,8 +623,7 @@ static PRStatus TestParseTime( void ) rc = PR_ParseTimeString( sp, PR_FALSE, &ct ); if ( PR_FAILURE == rc ) { - PR_LOG( lm, PR_LOG_ERROR, - ("TestParseTime(): PR_ParseTimeString() failed to convert: %s", sp )); + printf("TestParseTime(): PR_ParseTimeString() failed to convert: %s\n", sp ); rv = PR_FAILURE; failed_already = 1; } @@ -625,8 +633,7 @@ static PRStatus TestParseTime( void ) if ( !ExplodedTimeIsEqual( &cet, &ptp->et )) { - PR_LOG( lm, PR_LOG_ERROR, - ("TestParseTime(): Exploded time compare failed: %s", sp )); + printf("TestParseTime(): Exploded time compare failed: %s\n", sp ); if ( debug_mode ) { PrintExplodedTime( &cet ); @@ -691,23 +698,24 @@ int main(int argc, char** argv) PR_LOG( lm, PR_LOG_ERROR, ("TestExplodeImplodeTime() failed")); } - printf("Test 1: Calendar Time Test passed\n"); + else + printf("Test 1: Calendar Time Test passed\n"); if ( PR_FAILURE == TestNormalizeTime()) { PR_LOG( lm, PR_LOG_ERROR, ("TestNormalizeTime() failed")); } - - printf("Test 2: Normalize Time Test passed\n"); + else + printf("Test 2: Normalize Time Test passed\n"); if ( PR_FAILURE == TestParseTime()) { PR_LOG( lm, PR_LOG_ERROR, ("TestParseTime() failed")); } - - printf("Test 3: Parse Time Test passed\n"); + else + printf("Test 3: Parse Time Test passed\n"); #ifdef XP_MAC if (1) |