diff --git a/mailnews/news/src/nsNNTPArticleList.cpp b/mailnews/news/src/nsNNTPArticleList.cpp index aaface0ebe98..83fb51341091 100644 --- a/mailnews/news/src/nsNNTPArticleList.cpp +++ b/mailnews/news/src/nsNNTPArticleList.cpp @@ -113,10 +113,8 @@ nsNNTPArticleList::FinishAddingArticleKeys() { // make sure none of the deleted turned up on the idsOnServer list #ifdef HAVE_NEWSDB -#ifdef DEBUG_bienvenu for (PRInt32 i = 0; i < m_idsDeleted.GetSize(); i++) - PR_ASSERT (!m_idsOnServer.set->IsMember(m_idsDeleted.GetAt(i))); -#endif + NS_ASSERTION((!m_idsOnServer.set->IsMember(m_idsDeleted.GetAt(i)), "a deleted turned up on the idsOnServer list"); #endif return 0; } diff --git a/mailnews/news/src/nsNNTPHost.cpp b/mailnews/news/src/nsNNTPHost.cpp index 07a99da4f994..2aa110c219cb 100644 --- a/mailnews/news/src/nsNNTPHost.cpp +++ b/mailnews/news/src/nsNNTPHost.cpp @@ -61,7 +61,7 @@ nsresult nsNNTPHost::Initialize(nsINntpUrl *runningURL, const char *username, co m_username = nsnull; } - PR_ASSERT(port); + NS_ASSERTION(port, "port was 0"); if (port == 0) port = NEWS_PORT; m_port = port; @@ -137,7 +137,7 @@ void nsNNTPHost::OpenGroupFile(const PRIntn permissions) { #ifdef UNREADY_CODE - PR_ASSERT(permissions); + NS_ASSERTION(permissions, "no permissions"); if (!permissions) return; if (m_groupFile) { if (m_groupFilePermissions && @@ -207,7 +207,7 @@ nsNNTPHost::WriteNewsrc() { if (!m_groups) return NS_ERROR_NOT_INITIALIZED; #ifdef UNREADY_CODE - PR_ASSERT(m_dirty); + NS_ASSERTON(m_dirty, "m_dirty is null"); // Just to be sure. It's safest to go ahead and write it out anyway, // even if we do somehow get called without the dirty bit set. @@ -414,11 +414,11 @@ nsNNTPHost::SetNewsRCFilename(char* name) // OK, now create the new empty hostinfo file. OpenGroupFile(XP_FILE_WRITE_BIN); - PR_ASSERT(m_groupFile); + NS_ASSERTION(m_groupFile, "null ptr"); if (!m_groupFile) return NS_ERROR_NOT_INITIALIZED; OpenGroupFile(); - PR_ASSERT(m_groupFile); + NS_ASSERTION(m_groupFile, "null ptr"); if (!m_groupFile) return NS_ERROR_NOT_INITIALIZED; @@ -494,15 +494,14 @@ nsNNTPHost::ReadInitialPart() m_block[0] = '\0'; if (version != 1) { // The file got clobbered or damaged somehow. Throw it away. -#ifdef DEBUG_bienvenu - if (length > 0) - PR_ASSERT(PR_FALSE); // this really shouldn't happen, right? +#ifdef DEBUG_NEWS + NS_ASSERTION(length <= 0, "length > 0"); #endif OpenGroupFile(XP_FILE_WRITE_BIN); - PR_ASSERT(m_groupFile); + NS_ASSERTION(m_groupFile, "null ptr"); if (!m_groupFile) return -1; OpenGroupFile(); - PR_ASSERT(m_groupFile); + NS_ASSERTION(m_groupFile, "null ptr"); if (!m_groupFile) return -1; m_groupTreeDirty = 2; @@ -557,7 +556,7 @@ nsNNTPHost::SaveHostInfo() char* ptrcomma = nsnull; char* filename = nsnull; PRInt32 length = CreateFileHeader(); - PR_ASSERT(length < m_blockSize - 50); + NS_ASSERTION(length < m_blockSize - 50, "length >= m_blockSize - 50"); if (m_inhaled || length != m_fileStart) { m_groupTreeDirty = 2; } @@ -615,12 +614,12 @@ nsNNTPHost::SaveHostInfo() m_block[l] = '\0'; char* p1 = PL_strchr(ptr, LINEBREAK_START); char* p2 = PL_strchr(m_block, LINEBREAK_START); - PR_ASSERT(p1); + NS_ASSERTION(p1,"null ptr"); if (!p1 || !p2 || (p1 - ptr) != (p2 - m_block)) { m_groupTreeDirty = 2; break; } - PR_ASSERT(grec->GetFileOffset() > 100); // header is at least 100 bytes long + NS_ASSERTION(grec->GetFileOffset() > 100, "header is at least 100 bytes long"); XP_FileSeek(m_groupFile, grec->GetFileOffset(), SEEK_SET); XP_FileWrite(ptr, PL_strlen(ptr), m_groupFile); PR_Free(ptr); @@ -680,7 +679,7 @@ nsNNTPHost::SaveHostInfo() goto FAIL; } ptrcomma = PL_strchr(ptr, ','); - PR_ASSERT(ptrcomma); + NS_ASSERTION(ptrcomma, "null ptr"); if (!ptrcomma) { status = -1; goto FAIL; @@ -798,11 +797,16 @@ nsNNTPHost::InhaleLine(char* line, PRUint32 length, void* closure) else if (c == '.') { parent = state->lastInhaled; char* ptr = state->lastfullname + (lastdot - line); - PR_ASSERT(parent); + NS_ASSERTION(parent, "null ptr"); while (parent && ptr) { parent = parent->GetParent(); - PR_ASSERT(parent); - ptr = PL_strchr(ptr + 1, '.'); + NS_ASSERTION(parent, "null ptr"); + if (parent) { + ptr = PL_strchr(ptr + 1, '.'); + } + else { + ptr = nsnull; + } } } } @@ -810,7 +814,7 @@ nsNNTPHost::InhaleLine(char* line, PRUint32 length, void* closure) if (!parent) parent = state->tree->FindDescendant(line); *lastdot = '.'; - PR_ASSERT(parent); + NS_ASSERTION(parent, "null ptr"); if (!parent) { status = -1; goto DONE; @@ -838,7 +842,7 @@ nsNNTPHost::InhaleLine(char* line, PRUint32 length, void* closure) } if (tmp == nsnull) status = -2; // Indicates we're done. } - PR_ASSERT(comma - line < ((PRInt32)sizeof(state->lastfullname))); + NS_ASSERTION(comma - line < ((PRInt32)sizeof(state->lastfullname)), "unexpected"); if ((comma - line)/sizeof(char) < sizeof(state->lastfullname)) { PL_strncpyz(state->lastfullname, line, comma - line + 1); state->lastfullname[comma - line] = '\0'; @@ -861,7 +865,7 @@ nsNNTPHost::Inhale(PRBool force) } m_inhaled = PR_FALSE; } - PR_ASSERT(!m_inhaled); + NS_ASSERTION(!m_inhaled, "m_inhaled is not null"); if (m_inhaled) return -1; PRInt32 status = 0; OpenGroupFile(); @@ -905,7 +909,7 @@ nsNNTPHost::Inhale(PRBool force) PRInt32 nsNNTPHost::Exhale() { - PR_ASSERT(m_inhaled); + NS_ASSERTION(m_inhaled, "null ptr"); if (!m_inhaled) return -1; PRInt32 status = SaveHostInfo(); while (m_groupTree->GetChildren()) { @@ -919,7 +923,7 @@ nsNNTPHost::Exhale() PRInt32 nsNNTPHost::EmptyInhale() { - PR_ASSERT(!m_inhaled); + NS_ASSERTION(!m_inhaled, "m_inhaled is not null"); if (m_inhaled) return -1; while (m_groupTree->GetChildren()) { delete m_groupTree->GetChildren(); @@ -992,7 +996,7 @@ nsNNTPHost::AddGroup(const char *name, if (!group->IsCategoryContainer() && group->IsCategory()) { nsMsgGroupRecord *container = group->GetCategoryContainer(); - PR_ASSERT(container); + NS_ASSERTION(container,"null ptr"); if (!container) goto DONE; containerName = container->GetFullName(); if (!containerName) goto DONE; // Out of memory. @@ -1067,16 +1071,15 @@ nsNNTPHost::AddGroup(const char *name, if (NS_SUCCEEDED(rv) && PL_strcmp(name, name)) { rv = FindGroup(name, &newsInfo); - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "didn't find group"); } } #else - printf("hacked up nsNNTPHost.cpp\n"); - PR_ASSERT(0); + NS_ASSERTION(0, "hacked up nsNNTPHost.cpp"); #endif /* SETH_HACK */ PR_Free(groupLine); } - PR_ASSERT(newsInfo); + NS_ASSERTION(newsInfo, "null ptr"); if (!newsInfo) goto DONE; if (group->IsCategoryContainer()) { @@ -1087,7 +1090,7 @@ nsNNTPHost::AddGroup(const char *name, for (child = group->GetNextAlphabetic() ; child != end ; child = child->GetNextAlphabetic()) { - PR_ASSERT(child); + NS_ASSERTION(child, "null ptr"); if (!child) break; char* fullname = child->GetFullName(); if (!fullname) break; @@ -1107,8 +1110,7 @@ nsNNTPHost::AddGroup(const char *name, #if SETH_HACK ProcessLine(groupLine, PL_strlen(groupLine)); #else - printf("hacked up nsNNTPHost.cpp\n"); - PR_ASSERT(0); + NS_ASSERTION(0, "hacked up nsNNTPHost.cpp"); #endif /* SETH_HACK */ PR_Free(groupLine); } @@ -1128,7 +1130,7 @@ nsNNTPHost::AddGroup(const char *name, catContainer = SwitchNewsToCategoryContainer(newsInfo); if (catContainer) rv = NS_OK; } - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "failed to SwitchNewsToCategoryContainer"); if (NS_SUCCEEDED(rv)) { // XXX should this call be on catContainer or newsInfo? nsIMsgFolder *folder = getFolderFor(newsInfo); @@ -2079,7 +2081,7 @@ nsNNTPHost::LoadSingleEntry(nsMsgGroupRecord* parent, char* name, if (parent != m_groupTree) { char* pname = parent->GetFullName(); if (pname) { - PR_ASSERT(PL_strncmp(pname, name, PL_strlen(pname)) == 0); + NS_ASSERTION(PL_strncmp(pname, name, PL_strlen(pname)) == 0, "pname != name"); delete [] pname; pname = nsnull; } @@ -2129,10 +2131,10 @@ nsNNTPHost::FindOrCreateGroup(const char* name, nsMsgGroupRecord* parent = m_groupTree; const char* start = name; - PR_ASSERT(start && *start); + NS_ASSERTION(start && *start, "name was bad"); if (!start || !*start) return nsnull; - PR_ASSERT(*start != '.'); // names can't start with ".". + NS_ASSERTION(*start != '.', "names can't start with ."); if (*start == '.') return nsnull; while (*start) @@ -2141,10 +2143,9 @@ nsNNTPHost::FindOrCreateGroup(const char* name, const char* end = PL_strchr(start, '.'); if (!end) end = start + PL_strlen(start); PRInt32 length = end - start; - PR_ASSERT(length > 0); // names can't contain ".." or end in - // a ".". + NS_ASSERTION(length > 0, "names can't contain .. or end in ."); if (length <= 0) return nsnull; - PR_ASSERT((PRUint32)length < sizeof(buf)); + NS_ASSERTION((PRUint32)length < sizeof(buf), "bad length"); if ((PRUint32)length >= sizeof(buf)) return nsnull; PL_strncpyz(buf, start, length + 1); buf[length] = '\0'; @@ -2223,11 +2224,11 @@ nsNNTPHost::AssureAllDescendentsLoaded(nsMsgGroupRecord* group) { #ifdef UNREADY_CODE PRInt32 status = 0; - PR_ASSERT(group); + NS_ASSERTION(group, "null ptr"); if (!group) return -1; if (group->IsDescendentsLoaded()) return 0; m_blockStart = group->GetFileOffset(); - PR_ASSERT(group->GetFileOffset() > 0); + NS_ASSERTION(group->GetFileOffset() > 0, "bad offset"); if (group->GetFileOffset() == 0) return -1; InhaleState state; state.tree = m_groupTree; @@ -2235,7 +2236,7 @@ nsNNTPHost::AssureAllDescendentsLoaded(nsMsgGroupRecord* group) state.onlyIfChild = group; state.lastInhaled = nsnull; OpenGroupFile(); - PR_ASSERT(m_groupFile); + NS_ASSERTION(m_groupFile, "null ptr"); if (!m_groupFile) return -1; XP_FileSeek(m_groupFile, group->GetFileOffset(), SEEK_SET); char* buffer = nsnull; @@ -2417,19 +2418,19 @@ nsNNTPHost::DeleteFiles () { #ifdef UNREADY_CODE // hostinfo.dat - PR_ASSERT(m_hostinfofilename); + NS_ASSERTION(m_hostinfofilename, "null ptr"); if (m_hostinfofilename) XP_FileRemove (m_hostinfofilename, xpXoverCache); // newsrc file const char *newsrc = GetNewsrcFileName(); - PR_ASSERT(newsrc); + NS_ASSERTION(newsrc,"null ptr"); if (newsrc) XP_FileRemove (newsrc, xpNewsRC); // Delete directory const char *dbdirname = GetDBDirName(); - PR_ASSERT(dbdirname); + NS_ASSERTION(dbdirname, "null ptr"); if (dbdirname) return XP_RemoveDirectory (dbdirname, xpXoverCache); #endif @@ -2592,8 +2593,7 @@ nsNNTPHost::DisplaySubscribedGroup(nsINNTPNewsgroup *newsgroup, #if SETH_HACK rv = AddGroup(group, nsnull, &newsgroup); #else - printf("seth hack\n"); - PR_ASSERT(0); + NS_ASSERTION(0, "hack required."); #endif } diff --git a/mailnews/news/src/nsNNTPNewsgroupList.cpp b/mailnews/news/src/nsNNTPNewsgroupList.cpp index 2cf8f7067334..86e90999d633 100644 --- a/mailnews/news/src/nsNNTPNewsgroupList.cpp +++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp @@ -108,7 +108,7 @@ nsNNTPNewsgroupList::Initialize(nsINNTPHost *host, nsINntpUrl *runningURL, nsINN m_lastMsgNumber = 0; m_set = nsnull; #ifdef HAVE_PANES - PR_ASSERT(pane); + NS_ASSERTION(pane, "null ptr"); m_pane = pane; m_master = pane->GetMaster(); #endif @@ -204,7 +204,7 @@ nsNNTPNewsgroupList::GetRangeOfArtsToDownload( { PRBool emptyGroup_p = PR_FALSE; - PR_ASSERT(first && last); + NS_ASSERTION(first && last, "no first or no last"); if (!first || !last) return NS_MSG_FAILURE; *first = 0; @@ -308,7 +308,7 @@ nsNNTPNewsgroupList::GetRangeOfArtsToDownload( { /* We're displaying some other group. Clear out that display, and set up everything to return the proper first chunk. */ - PR_ASSERT(PR_FALSE); // ### dmb todo - need nwo way of doing this + NS_ASSERTION(0, "todo - need new way of doing"); if (emptyGroup_p) { if (status) *status=0; return NS_OK; @@ -475,7 +475,7 @@ nsNNTPNewsgroupList::InitXOVER(PRInt32 first_msg, PRInt32 last_msg) #endif /* Consistency checks, not that I know what to do if it fails (it will probably handle it OK...) */ - PR_ASSERT(first_msg <= last_msg); + NS_ASSERTION(first_msg <= last_msg, "first > last"); /* If any XOVER lines from the last time failed to come in, mark those messages as read. */ @@ -709,7 +709,7 @@ nsNNTPNewsgroupList::ProcessXOVERLINE(const char *line, PRUint32 *status) PRBool read_p = PR_FALSE; nsresult rv = NS_OK; - PR_ASSERT (line); + NS_ASSERTION(line, "null ptr"); if (!line) return NS_ERROR_NULL_POINTER; @@ -725,8 +725,8 @@ nsNNTPNewsgroupList::ProcessXOVERLINE(const char *line, PRUint32 *status) else return NS_ERROR_NOT_INITIALIZED; - PR_ASSERT(message_number > m_lastProcessedNumber || - message_number == 1); + NS_ASSERTION(message_number > m_lastProcessedNumber || + message_number == 1, "bad message_number"); if (m_set && message_number > m_lastProcessedNumber + 1) { /* There are some articles that XOVER skipped; they must no longer diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index 4df2ffcfcf45..bf23bf0246f7 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -657,7 +657,7 @@ nsresult nsNNTPProtocol::LoadUrl(nsIURI * aURL, nsISupports * aConsumer) goto FAIL; } #endif - /* PR_ASSERT (!group && !message_id && !commandSpecificData); */ + /* NS_ASSERTION (!group && !message_id && !commandSpecificData, "something not null"); */ m_typeWanted = NEWS_POST; NET_SACopy(&m_path, ""); } @@ -956,7 +956,7 @@ nsresult nsNNTPProtocol::ParseURL(nsIURI * aURL, PRBool * bValP, char ** aGroup, if (message_id) { /* Move past the @. */ - PR_ASSERT (s && *s == '@'); + NS_ASSERTION (s && *s == '@', "move past the @"); start = s; } else @@ -994,7 +994,7 @@ nsresult nsNNTPProtocol::ParseURL(nsIURI * aURL, PRBool * bValP, char ** aGroup, } FAIL: - PR_ASSERT (!message_id || message_id != group); + NS_ASSERTION (!message_id || message_id != group, "something not null"); if (status >= 0) { if (aGroup) @@ -1746,7 +1746,7 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURI * url) } else { - PR_ASSERT(PR_FALSE); + NS_ASSERTION(PR_FALSE, "unexpected"); m_nextState = NNTP_ERROR; } } @@ -1873,7 +1873,7 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommandResponse() nsMsgKey key = nsMsgKey_None; rv = m_runningURL->GetMessageKey(&key); - PR_ASSERT(m_messageID && (key != nsMsgKey_None)); + NS_ASSERTION(m_messageID && (key != nsMsgKey_None), "unexpected"); if (m_messageID && (key != nsMsgKey_None)) { PR_snprintf(outputBuffer,OUTPUT_BUFFER_SIZE,"

<%.512s> (%lu)", m_messageID, key); m_tempErrorStream->Write(outputBuffer, PL_strlen(outputBuffer), &count); @@ -1940,7 +1940,7 @@ PRInt32 nsNNTPProtocol::SendGroupForArticle() PR_FREEIF(m_currentGroup); rv = m_newsgroup->GetName(&m_currentGroup); - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "GetName failed"); char outputBuffer[OUTPUT_BUFFER_SIZE]; PR_snprintf(outputBuffer, @@ -2007,7 +2007,7 @@ PRInt32 nsNNTPProtocol::BeginArticle() if (m_typeWanted == CANCEL_WANTED) { #ifdef UNREADY_CODE - PR_ASSERT(ce->format_out == FO_PRESENT); + NS_ASSERTION(ce->format_out == FO_PRESENT, "format_out != FO_PRESENT"); ce->format_out = FO_PRESENT; #endif } @@ -2027,7 +2027,7 @@ PRInt32 nsNNTPProtocol::BeginArticle() } cd->stream = NET_StreamBuilder(ce->format_out, ce->URL_s, ce->window_id); - PR_ASSERT (cd->stream); + NS_ASSERTION (cd->stream, "no stream"); if (!cd->stream) return -1; #endif @@ -2593,7 +2593,7 @@ PRInt32 nsNNTPProtocol::AuthorizationResponse() return(MK_NNTP_AUTH_FAILED); } - PR_ASSERT(0); /* should never get here */ + NS_ASSERTION(0,"should never get here"); return(-1); } @@ -2642,7 +2642,7 @@ PRInt32 nsNNTPProtocol::PasswordResponse() return(MK_NNTP_AUTH_FAILED); } - PR_ASSERT(0); /* should never get here */ + NS_ASSERTION(0,"should never get here"); return(-1); } @@ -2711,7 +2711,7 @@ PRInt32 nsNNTPProtocol::ProcessNewsgroups(nsIInputStream * inputStream, PRUint32 if (NS_SUCCEEDED(rv) && m_newsgroup) { rv = m_newsHost->FindGroup(groupName, getter_AddRefs(m_newsgroup)); - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "FindGroup failed"); m_nextState = NNTP_LIST_XACTIVE; #ifdef DEBUG_NEWS printf("listing xactive for %s\n", groupName); @@ -3074,7 +3074,7 @@ PRInt32 nsNNTPProtocol::ReadXoverResponse() something went very wrong, since our servers do XOVER. Thus the assert. */ - /*PR_ASSERT (0);*/ + /*NS_ASSERTION (0,"something went very wrong");*/ m_nextState = NNTP_READ_GROUP; SetFlag(NNTP_NO_XOVER_SUPPORT); } @@ -3135,7 +3135,7 @@ PRInt32 nsNNTPProtocol::ReadXover(nsIInputStream * inputStream, PRUint32 length) } rv = m_newsgroupList->ProcessXOVERLINE(line, &status); - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "failed to process the XOVERLINE"); m_numArticlesLoaded++; PR_FREEIF(line); @@ -3664,8 +3664,7 @@ PRInt32 nsNNTPProtocol::DisplayNewsRCResponse() high ? atol(high) : 0, atol(num_arts), PR_FALSE); #else - printf("seth hack\n"); - PR_ASSERT(0); + NS_ASSERTION(0,"hack required"); #endif if (status < 0) return status; @@ -3685,8 +3684,7 @@ PRInt32 nsNNTPProtocol::DisplayNewsRCResponse() m_newsHost->DisplaySubscribedGroup(m_currentGroup, 0, 0, 0, PR_FALSE); #else - printf("seth hack\n"); - PR_ASSERT(0); + NS_ASSERTION(0,"hack required"); #endif } @@ -3805,14 +3803,14 @@ PRInt32 nsNNTPProtocol::DoCancel() message at it... But the normal posting code doesn't do this check. Why? */ - PR_ASSERT (m_responseCode == MK_NNTP_RESPONSE_POST_SEND_NOW); + NS_ASSERTION (m_responseCode == MK_NNTP_RESPONSE_POST_SEND_NOW, "code != POST_SEND_NOW"); // These shouldn't be set yet, since the headers haven't been "flushed" // "Distribution: " doesn't appear to be required, so // don't assert on m_cancelDistribution - PR_ASSERT (m_cancelID && + NS_ASSERTION (m_cancelID && m_cancelFromHdr && - m_cancelNewsgroups); + m_cancelNewsgroups, "null ptr"); newsgroups = m_cancelNewsgroups; distribution = m_cancelDistribution; @@ -3823,7 +3821,7 @@ PRInt32 nsNNTPProtocol::DoCancel() NS_WITH_SERVICE(nsIPrompt, dialog, kCNetSupportDialogCID, &rv); if (NS_FAILED(rv) || !dialog) return -1; /* unable to get the dialog service */ - PR_ASSERT (id && newsgroups); + NS_ASSERTION (id && newsgroups, "null ptr"); if (!id || !newsgroups) return -1; /* "unknown error"... */ m_cancelNewsgroups = nsnull; @@ -3969,7 +3967,7 @@ PRInt32 nsNNTPProtocol::DoCancel() // delete the message from the db here. nsMsgKey key = nsMsgKey_None; rv = m_runningURL->GetMessageKey(&key); - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "GetMessageKey failed"); char *newsgroupname = nsnull; rv = m_runningURL->GetNewsgroupName(&newsgroupname); NS_ASSERTION(NS_SUCCEEDED(rv) && newsgroupname && (key != nsMsgKey_None), "need more to remove this message from the db"); @@ -4215,7 +4213,7 @@ PRInt32 nsNNTPProtocol::ListXActiveResponse(nsIInputStream * inputStream, PRUint char *line; PRUint32 status = 0; - PR_ASSERT(m_responseCode == MK_NNTP_RESPONSE_LIST_OK); + NS_ASSERTION(m_responseCode == MK_NNTP_RESPONSE_LIST_OK, "code != LIST_OK"); if (m_responseCode != MK_NNTP_RESPONSE_LIST_OK) { m_nextState = DISPLAY_NEWSGROUPS; @@ -4368,7 +4366,7 @@ PRInt32 nsNNTPProtocol::ListGroupResponse(nsIInputStream * inputStream, PRUint32 char *line; PRUint32 status = 0; - PR_ASSERT(m_responseCode == MK_NNTP_RESPONSE_GROUP_SELECTED); + NS_ASSERTION(m_responseCode == MK_NNTP_RESPONSE_GROUP_SELECTED, "code != GROUP_SELECTED"); if (m_responseCode != MK_NNTP_RESPONSE_GROUP_SELECTED) { m_nextState = NEWS_DONE; @@ -4412,7 +4410,7 @@ PRInt32 nsNNTPProtocol::ListGroupResponse(nsIInputStream * inputStream, PRUint32 PRInt32 nsNNTPProtocol::Search() { - PR_ASSERT(PR_FALSE); + NS_ASSERTION(0,"Search not implemented"); return 0; } @@ -4497,7 +4495,7 @@ PRInt32 nsNNTPProtocol::SetupForTransfer() #endif else { - PR_ASSERT(0); + NS_ASSERTION(0, "unexpected"); return -1; } @@ -4961,7 +4959,7 @@ nsresult nsNNTPProtocol::CloseSocket() nsresult rv; /* XXX - how/when to Release() this? */ rv = m_newsgroupList->FinishXOVERLINE(status,&status); - PR_ASSERT(NS_SUCCEEDED(rv)); + NS_ASSERTION(NS_SUCCEEDED(rv), "FinishXOVERLINE failed"); if (NS_SUCCEEDED(rv) && status >= 0 && status < 0) status = status; } diff --git a/mailnews/news/src/nsNewsFolder.cpp b/mailnews/news/src/nsNewsFolder.cpp index c32116596d4e..18c26af58a8e 100644 --- a/mailnews/news/src/nsNewsFolder.cpp +++ b/mailnews/news/src/nsNewsFolder.cpp @@ -240,7 +240,7 @@ nsMsgNewsFolder::AddSubfolder(nsAutoString name, nsIMsgFolder **child, char *set nsresult nsMsgNewsFolder::ParseFolder(nsFileSpec& path) { - PR_ASSERT(0); + NS_ASSERTION(0,"ParseFolder not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -323,14 +323,14 @@ nsMsgNewsFolder::GetSubFolders(nsIEnumerator* *result) NS_IMETHODIMP nsMsgNewsFolder::AddUnique(nsISupports* element) { - PR_ASSERT(0); + NS_ASSERTION(0,"AddUnique not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsMsgNewsFolder::ReplaceElement(nsISupports* element, nsISupports* newElement) { - PR_ASSERT(0); + NS_ASSERTION(0,"ReplaceElement not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -498,19 +498,19 @@ NS_IMETHODIMP nsMsgNewsFolder::CreateSubfolder(const char *newsgroupname) NS_IMETHODIMP nsMsgNewsFolder::Delete() { - PR_ASSERT(0); + NS_ASSERTION(0,"Delete not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsMsgNewsFolder::Rename(const char *newName) { - PR_ASSERT(0); + NS_ASSERTION(0,"Rename not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsMsgNewsFolder::Adopt(nsIMsgFolder *srcFolder, PRUint32 *outPos) { - PR_ASSERT(0); + NS_ASSERTION(0,"Adopt not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -803,13 +803,13 @@ NS_IMETHODIMP nsMsgNewsFolder::GetCanBeRenamed(PRBool *canBeRenamed) NS_IMETHODIMP nsMsgNewsFolder::GetRequiresCleanup(PRBool *requiresCleanup) { - PR_ASSERT(0); + NS_ASSERTION(0,"GetRequiresCleanup not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsMsgNewsFolder::GetSizeOnDisk(PRUint32 *size) { - PR_ASSERT(0); + NS_ASSERTION(0, "GetSizeOnDisk not implemented"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -1155,7 +1155,7 @@ nsMsgNewsFolder::HandleLine(char* line, PRUint32 line_size) for (child = group->GetNextAlphabetic() ; child != end ; child = child->GetNextAlphabetic()) { - PR_ASSERT(child); + NS_ASSERTION(child,"null ptr"); if (!child) break; char* fullname = child->GetFullName(); if (!fullname) break; diff --git a/mailnews/news/src/nsNntpUrl.cpp b/mailnews/news/src/nsNntpUrl.cpp index 0f48ac142a64..f989e7c351da 100644 --- a/mailnews/news/src/nsNntpUrl.cpp +++ b/mailnews/news/src/nsNntpUrl.cpp @@ -383,7 +383,7 @@ NS_IMETHODIMP nsNntpUrl::GetNewsgroupName(char ** aNewsgroupName) { if (!*aNewsgroupName) return NS_ERROR_NULL_POINTER; - PR_ASSERT(m_newsgroupName); + NS_ASSERTION(m_newsgroupName, "null ptr"); if (!m_newsgroupName) return NS_ERROR_FAILURE; *aNewsgroupName = PL_strdup(m_newsgroupName);