printf("Port test: %s\n", port == urlPort ? "PASSED." : "FAILED!");
printf("Port test: %s\n", port == (PRUint32)urlPort ? "PASSED." : "FAILED!");
nsresult nsIMAP4TestDriver::OnTestUrlParsing(){	nsresult rv = NS_OK; 	char * hostName = nsnull;	PRUint32 port = IMAP_PORT;	char * displayString = nsnull;		PL_strcpy(m_userData, DEFAULT_HOST);	displayString = PR_smprintf("Enter a host name for the imap url [%s]: ", m_userData);	rv = PromptForUserData(displayString);	PR_FREEIF(displayString);	hostName = PL_strdup(m_userData);	PL_strcpy(m_userData, "143");	displayString = PR_smprintf("Enter port number if any for the imap url [%d] (use 0 to skip port field): ", IMAP_PORT);	rv = PromptForUserData(displayString);	PR_FREEIF(displayString);		port = atol(m_userData);	// as we had more functionality to the imap url, we'll probably need to ask for more information than just	// the host and the port...	nsIImapUrl * imapUrl = nsnull;		nsComponentManager::CreateInstance(kImapUrlCID, nsnull /* progID */, nsIImapUrl::GetIID(), (void **) &imapUrl);	if (imapUrl)	{		char * urlSpec = nsnull;		if (m_port > 0) // did the user specify a port? 			urlSpec = PR_smprintf("imap://%s:%d", hostName, port);		else			urlSpec = PR_smprintf("imap://%s", hostName);		nsCOMPtr<nsIMsgMailNewsUrl> mailnewsurl = do_QueryInterface(imapUrl);		mailnewsurl->SetSpec("imap://nsmail-2.mcom.com:143/test");				char * urlHost = nsnull;		PRInt32 urlPort = 0;		mailnewsurl->GetHost(&urlHost);		mailnewsurl->GetPort(&urlPort);		printf("Host name test: %s\n", PL_strcmp(urlHost, hostName) == 0 ? "PASSED." : "FAILED!");		if (port > 0) // did the user try to test the port?			printf("Port test: %s\n", port == urlPort ? "PASSED." : "FAILED!");		NS_IF_RELEASE(imapUrl);	}	else		printf("Failure!! Unable to create an imap url. Registration problem? \n");	PR_FREEIF(hostName);	return rv;}