From 1e2bc36b9bf9e72b7baf4929c3ca5ede1438d9a0 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Thu, 2 Dec 1999 06:24:07 +0000 Subject: [PATCH] port this to unix so I stop breaking the tree test only, no review necessary --- mailnews/compose/tests/compose2/Makefile.in | 2 ++ mailnews/compose/tests/compose2/test2.cpp | 19 ++++++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/mailnews/compose/tests/compose2/Makefile.in b/mailnews/compose/tests/compose2/Makefile.in index b3c678f4af4..4c1403ef55b 100644 --- a/mailnews/compose/tests/compose2/Makefile.in +++ b/mailnews/compose/tests/compose2/Makefile.in @@ -32,10 +32,12 @@ CPPSRCS = test2.cpp LIBS = \ $(MOZ_TIMER_LIBS) \ + $(NSPR_LIBS) \ -lxpcom \ -lmozjs \ -lraptorgfx \ $(NULL) + include $(topsrcdir)/config/rules.mk diff --git a/mailnews/compose/tests/compose2/test2.cpp b/mailnews/compose/tests/compose2/test2.cpp index bdb7104b5a5..02690586206 100644 --- a/mailnews/compose/tests/compose2/test2.cpp +++ b/mailnews/compose/tests/compose2/test2.cpp @@ -68,6 +68,10 @@ #endif #endif +#ifndef TPATH_LEN +#define TPATH_LEN 1024 +#endif + ///////////////////////////////////////////////////////////////////////////////// // Define keys for all of the interfaces we are going to require for this test @@ -123,7 +127,8 @@ GetHackIdentity() { nsresult rv; - NS_WITH_SERVICE(nsIMsgMailSession, mailSession, kCMsgMailSessionCID, &rv); + NS_WITH_SERVICE(nsIMsgAccountManager, accountManager, + NS_MSGACCOUNTMANAGER_PROGID, &rv); if (NS_FAILED(rv)) { printf("Failure on Mail Session Init!\n"); @@ -131,16 +136,8 @@ nsresult rv; } nsCOMPtr identity = nsnull; - nsCOMPtr accountManager; - rv = mailSession->GetAccountManager(getter_AddRefs(accountManager)); - if (NS_FAILED(rv)) - { - printf("Failure getting account Manager!\n"); - return nsnull; - } - - rv = mailSession->GetCurrentIdentity(getter_AddRefs(identity)); + rv = accountManager->GetCurrentIdentity(getter_AddRefs(identity)); if (NS_FAILED(rv)) { printf("Failure getting Identity!\n"); @@ -318,7 +315,7 @@ WriteTempMailFile(nsFileSpec *mailFile) nsIMsgIdentity *identity = GetHackIdentity(); const char *to = "rhp@netscape.com"; char *aEmail = nsnull; - char *aFullName = nsnull; + PRUnichar *aFullName = nsnull; char addr[256]; char subject[256]; char emailMessage[2048];