diff --git a/xpcom/proxy/src/nsProxyEvent.cpp b/xpcom/proxy/src/nsProxyEvent.cpp index b6628c1efbdc..9e4e95cea0f4 100644 --- a/xpcom/proxy/src/nsProxyEvent.cpp +++ b/xpcom/proxy/src/nsProxyEvent.cpp @@ -180,6 +180,8 @@ nsProxyObjectCallInfo::Run() mParameterCount, mParameterList); + PROXY_LOG(("PROXY(%p): Run Returns [%d]\n", this, mResult)); + if (IsSync()) { PostCompleted(); } diff --git a/xpcom/proxy/tests/Makefile.in b/xpcom/proxy/tests/Makefile.in index 55490e5d81e3..26be45c03ffa 100644 --- a/xpcom/proxy/tests/Makefile.in +++ b/xpcom/proxy/tests/Makefile.in @@ -49,7 +49,15 @@ REQUIRES = xpcom CPPSRCS = proxytests.cpp \ proxy-create-threadsafety.cpp \ $(NULL) -XPIDLSRCS = nsITestProxy.idl + +CPP_UNIT_TESTS += \ + proxytests.cpp \ + proxy-create-threadsafety.cpp \ + $(NULL) + +XPIDLSRCS = \ + nsITestProxy.idl \ + nsITestProxyOrig.idl SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX)) diff --git a/xpcom/proxy/tests/nsITestProxy.idl b/xpcom/proxy/tests/nsITestProxy.idl index 98cb3f94ceae..1b430f5d806e 100644 --- a/xpcom/proxy/tests/nsITestProxy.idl +++ b/xpcom/proxy/tests/nsITestProxy.idl @@ -3,7 +3,79 @@ [uuid(1979e980-1cfd-11d3-915e-0000863011c4)] interface nsITestProxy : nsISupports { - long Test(in long p1, in long p2); - void Test2(); - void Test3(in nsISupports p1, out nsISupports p2); +long Test(in long p1, in long p2); +nsresult Test2(); +nsresult Test3(in nsISupports p1, out nsISupports p2); + +nsresult Test1_1(inout PRInt32 p1); +nsresult Test1_2(inout PRInt64 p1); +nsresult Test1_3(inout float p1); +nsresult Test1_4(inout double p1); +nsresult Test1_5(inout nsISupports p1); + +nsresult Test2_1(inout PRInt32 p1, inout PRInt32 p2); +nsresult Test2_2(inout PRInt64 p1, inout PRInt64 p2); +nsresult Test2_3(inout float p1, inout float p2); +nsresult Test2_4(inout double p1, inout double p2); +nsresult Test2_5(inout nsISupports p1, inout nsISupports p2); + +nsresult Test3_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3); +nsresult Test3_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3); +nsresult Test3_3(inout float p1, inout float p2, inout float p3); +nsresult Test3_4(inout double p1, inout double p2, inout double p3); +nsresult Test3_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3); + +nsresult Test4_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4); +nsresult Test4_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4); +nsresult Test4_3(inout float p1, inout float p2, inout float p3, inout float p4); +nsresult Test4_4(inout double p1, inout double p2, inout double p3, inout double p4); +nsresult Test4_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4); + +nsresult Test5_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4, inout PRInt32 p5); +nsresult Test5_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4, inout PRInt64 p5); +nsresult Test5_3(inout float p1, inout float p2, inout float p3, inout float p4, inout float p5); +nsresult Test5_4(inout double p1, inout double p2, inout double p3, inout double p4, inout double p5); +nsresult Test5_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4, inout nsISupports p5); + +nsresult Test6_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4, inout PRInt32 p5, inout PRInt32 p6); +nsresult Test6_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4, inout PRInt64 p5, inout PRInt64 p6); +nsresult Test6_3(inout float p1, inout float p2, inout float p3, inout float p4, inout float p5, inout float p6); +nsresult Test6_4(inout double p1, inout double p2, inout double p3, inout double p4, inout double p5, inout double p6); +nsresult Test6_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4, inout nsISupports p5, inout nsISupports p6); + +nsresult Test7_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4, inout PRInt32 p5, inout PRInt32 p6, inout PRInt32 p7); +nsresult Test7_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4, inout PRInt64 p5, inout PRInt64 p6, inout PRInt64 p7); +nsresult Test7_3(inout float p1, inout float p2, inout float p3, inout float p4, inout float p5, inout float p6, inout float p7); +nsresult Test7_4(inout double p1, inout double p2, inout double p3, inout double p4, inout double p5, inout double p6, inout double p7); +nsresult Test7_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4, inout nsISupports p5, inout nsISupports p6, inout nsISupports p7); + +nsresult Test8_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4, inout PRInt32 p5, inout PRInt32 p6, inout PRInt32 p7, inout PRInt32 p8); +nsresult Test8_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4, inout PRInt64 p5, inout PRInt64 p6, inout PRInt64 p7, inout PRInt64 p8); +nsresult Test8_3(inout float p1, inout float p2, inout float p3, inout float p4, inout float p5, inout float p6, inout float p7, inout float p8); +nsresult Test8_4(inout double p1, inout double p2, inout double p3, inout double p4, inout double p5, inout double p6, inout double p7, inout double p8); +nsresult Test8_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4, inout nsISupports p5, inout nsISupports p6, inout nsISupports p7, inout nsISupports p8); + +nsresult Test9_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4, inout PRInt32 p5, inout PRInt32 p6, inout PRInt32 p7, inout PRInt32 p8, inout PRInt32 p9); +nsresult Test9_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4, inout PRInt64 p5, inout PRInt64 p6, inout PRInt64 p7, inout PRInt64 p8, inout PRInt64 p9); +nsresult Test9_3(inout float p1, inout float p2, inout float p3, inout float p4, inout float p5, inout float p6, inout float p7, inout float p8, inout float p9); +nsresult Test9_4(inout double p1, inout double p2, inout double p3, inout double p4, inout double p5, inout double p6, inout double p7, inout double p8, inout double p9); +nsresult Test9_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4, inout nsISupports p5, inout nsISupports p6, inout nsISupports p7, inout nsISupports p8, inout nsISupports p9); + +nsresult Test10_1(inout PRInt32 p1, inout PRInt32 p2, inout PRInt32 p3, inout PRInt32 p4, inout PRInt32 p5, inout PRInt32 p6, inout PRInt32 p7, inout PRInt32 p8, inout PRInt32 p9, inout PRInt32 p10); +nsresult Test10_2(inout PRInt64 p1, inout PRInt64 p2, inout PRInt64 p3, inout PRInt64 p4, inout PRInt64 p5, inout PRInt64 p6, inout PRInt64 p7, inout PRInt64 p8, inout PRInt64 p9, inout PRInt64 p10); +nsresult Test10_3(inout float p1, inout float p2, inout float p3, inout float p4, inout float p5, inout float p6, inout float p7, inout float p8, inout float p9, inout float p10); +nsresult Test10_4(inout double p1, inout double p2, inout double p3, inout double p4, inout double p5, inout double p6, inout double p7, inout double p8, inout double p9, inout double p10); +nsresult Test10_5(inout nsISupports p1, inout nsISupports p2, inout nsISupports p3, inout nsISupports p4, inout nsISupports p5, inout nsISupports p6, inout nsISupports p7, inout nsISupports p8, inout nsISupports p9, inout nsISupports p10); + }; + + +[uuid(1979e980-1cfd-11d3-915e-0000863011c5)] +interface nsITestProxy2 : nsISupports +{ +long Test(in long p1, in long p2); +nsresult Test2(); +nsresult Test3(in nsISupports p1, out nsISupports p2); + +}; + diff --git a/xpcom/proxy/tests/nsITestProxyOrig.idl b/xpcom/proxy/tests/nsITestProxyOrig.idl new file mode 100644 index 000000000000..c749a352a0e8 --- /dev/null +++ b/xpcom/proxy/tests/nsITestProxyOrig.idl @@ -0,0 +1,9 @@ +#include "nsISupports.idl" + +[uuid(1979e980-1cfd-11d3-915e-0000863011c4)] +interface nsITestProxy : nsISupports +{ + long Test(in long p1, in long p2); + void Test2(); + void Test3(in nsISupports p1, out nsISupports p2); +}; diff --git a/xpcom/proxy/tests/proxy-create-threadsafety.cpp b/xpcom/proxy/tests/proxy-create-threadsafety.cpp index 4e6b5c3fa265..47f503970d03 100644 --- a/xpcom/proxy/tests/proxy-create-threadsafety.cpp +++ b/xpcom/proxy/tests/proxy-create-threadsafety.cpp @@ -50,7 +50,7 @@ #include "nspr.h" #include "prmon.h" -#include "nsITestProxy.h" +#include "nsITestProxyOrig.h" #include "nsISupportsPrimitives.h" #include "nsIRunnable.h" @@ -92,169 +92,169 @@ M Create two threads /***************************************************************************/ class ProxyTest : public nsIRunnable, - public nsITestProxy, - public nsISupportsPrimitive +public nsITestProxyOrig, +public nsISupportsPrimitive { -public: - ProxyTest() - : mCounter(0) - {} + public: + ProxyTest() + : mCounter(0) + {} - NS_IMETHOD Run() - { - nsresult rv; - nsCOMPtr pom = - do_GetService(NS_XPCOMPROXY_CONTRACTID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr prim; - rv = pom->GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsISupportsPrimitive), - NS_ISUPPORTS_CAST(nsIRunnable*, this), - NS_PROXY_SYNC | NS_PROXY_ALWAYS, - getter_AddRefs(prim)); - NS_ENSURE_SUCCESS(rv, rv); + NS_IMETHOD Run() + { + nsresult rv; + nsCOMPtr pom = + do_GetService(NS_XPCOMPROXY_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr prim; + rv = pom->GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, + NS_GET_IID(nsISupportsPrimitive), + NS_ISUPPORTS_CAST(nsIRunnable*, this), + NS_PROXY_SYNC | NS_PROXY_ALWAYS, + getter_AddRefs(prim)); + NS_ENSURE_SUCCESS(rv, rv); /* we don't actually need to use the proxied object */ - return NS_OK; - } + return NS_OK; + } - NS_IMETHOD Test(PRInt32 p1, PRInt32 p2, PRInt32 *_retval) - { - nsresult rv; + NS_IMETHOD Test(PRInt32 p1, PRInt32 p2, PRInt32 *_retval) + { + nsresult rv; - if (!NS_IsMainThread()) - return NS_ERROR_UNEXPECTED; + if (!NS_IsMainThread()) + return NS_ERROR_UNEXPECTED; - mCounterLock = nsAutoLock::NewLock(__FILE__ " counter lock"); - NS_ENSURE_TRUE(mCounterLock, NS_ERROR_OUT_OF_MEMORY); - mEvilMonitor = nsAutoMonitor::NewMonitor(__FILE__ " evil monitor"); - NS_ENSURE_TRUE(mEvilMonitor, NS_ERROR_OUT_OF_MEMORY); + mCounterLock = nsAutoLock::NewLock(__FILE__ " counter lock"); + NS_ENSURE_TRUE(mCounterLock, NS_ERROR_OUT_OF_MEMORY); + mEvilMonitor = nsAutoMonitor::NewMonitor(__FILE__ " evil monitor"); + NS_ENSURE_TRUE(mEvilMonitor, NS_ERROR_OUT_OF_MEMORY); /* note that we don't have an event queue... */ - rv = NS_NewThread(getter_AddRefs(mThreadOne), - static_cast(this)); - NS_ENSURE_SUCCESS(rv, rv); - rv = NS_NewThread(getter_AddRefs(mThreadTwo), - static_cast(this)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mThreadOne->Shutdown(); - NS_ENSURE_SUCCESS(rv, rv); - rv = mThreadTwo->Shutdown(); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; - } - - NS_IMETHOD Test2(void) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD Test3(nsISupports *p1, nsISupports **p2) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD GetType(PRUint16 *_retval) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) - { - NS_ASSERTION(aInstancePtr, - "QueryInterface requires a non-NULL destination!"); - nsISupports* foundInterface; - if ( aIID.Equals(NS_GET_IID(nsIRunnable)) ) { - foundInterface = static_cast(this); - } else if ( aIID.Equals(NS_GET_IID(nsITestProxy)) ) { - foundInterface = static_cast(this); - } else if ( aIID.Equals(NS_GET_IID(nsISupports)) ) { - foundInterface = NS_ISUPPORTS_CAST(nsIRunnable*, this); - } else if ( aIID.Equals(NS_GET_IID(nsISupportsPrimitive)) ) { - { - nsAutoLock counterLock(mCounterLock); - switch(mCounter) { - case 0: - ++mCounter; - { - /* be evil here and hang */ - nsAutoUnlock counterUnlock(mCounterLock); - nsAutoMonitor evilMonitor(mEvilMonitor); - nsresult rv = evilMonitor.Wait(); + rv = NS_NewThread(getter_AddRefs(mThreadOne), + static_cast(this)); NS_ENSURE_SUCCESS(rv, rv); - break; - } - case 1: - ++mCounter; - { - /* okay, we had our fun, un-hang */ - nsAutoUnlock counterUnlock(mCounterLock); - nsAutoMonitor evilMonitor(mEvilMonitor); - nsresult rv = evilMonitor.Notify(); + rv = NS_NewThread(getter_AddRefs(mThreadTwo), + static_cast(this)); NS_ENSURE_SUCCESS(rv, rv); - break; - } - default: { - /* nothing special here */ - ++mCounter; - } + + rv = mThreadOne->Shutdown(); + NS_ENSURE_SUCCESS(rv, rv); + rv = mThreadTwo->Shutdown(); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; } - ++mCounter; - } + + NS_IMETHOD Test2(void) + { + return NS_ERROR_NOT_IMPLEMENTED; + } + + NS_IMETHOD Test3(nsISupports *p1, nsISupports **p2) + { + return NS_ERROR_NOT_IMPLEMENTED; + } + + NS_IMETHOD GetType(PRUint16 *_retval) + { + return NS_ERROR_NOT_IMPLEMENTED; + } + + NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) + { + NS_ASSERTION(aInstancePtr, + "QueryInterface requires a non-NULL destination!"); + nsISupports* foundInterface; + if ( aIID.Equals(NS_GET_IID(nsIRunnable)) ) { + foundInterface = static_cast(this); + } else if ( aIID.Equals(NS_GET_IID(nsITestProxyOrig)) ) { + foundInterface = static_cast(this); + } else if ( aIID.Equals(NS_GET_IID(nsISupports)) ) { + foundInterface = NS_ISUPPORTS_CAST(nsIRunnable*, this); + } else if ( aIID.Equals(NS_GET_IID(nsISupportsPrimitive)) ) { + { + nsAutoLock counterLock(mCounterLock); + switch(mCounter) { + case 0: + ++mCounter; + { + /* be evil here and hang */ + nsAutoUnlock counterUnlock(mCounterLock); + nsAutoMonitor evilMonitor(mEvilMonitor); + nsresult rv = evilMonitor.Wait(); + NS_ENSURE_SUCCESS(rv, rv); + break; + } + case 1: + ++mCounter; + { + /* okay, we had our fun, un-hang */ + nsAutoUnlock counterUnlock(mCounterLock); + nsAutoMonitor evilMonitor(mEvilMonitor); + nsresult rv = evilMonitor.Notify(); + NS_ENSURE_SUCCESS(rv, rv); + break; + } + default: { + /* nothing special here */ + ++mCounter; + } + } + ++mCounter; + } // remeber to admit to supporting this interface - foundInterface = static_cast(this); - } else { - foundInterface = nsnull; - } - nsresult status; - if (!foundInterface) { - status = NS_ERROR_NO_INTERFACE; - } else { - NS_ADDREF(foundInterface); - status = NS_OK; - } - *aInstancePtr = foundInterface; - return status; - } + foundInterface = static_cast(this); + } else { + foundInterface = nsnull; + } + nsresult rv; + if (!foundInterface) { + rv = NS_ERROR_NO_INTERFACE; + } else { + NS_ADDREF(foundInterface); + rv = NS_OK; + } + *aInstancePtr = foundInterface; + return rv; + } - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); + NS_IMETHOD_(nsrefcnt) AddRef(void); + NS_IMETHOD_(nsrefcnt) Release(void); -protected: - nsAutoRefCnt mRefCnt; - NS_DECL_OWNINGTHREAD + protected: + nsAutoRefCnt mRefCnt; + NS_DECL_OWNINGTHREAD -private: - PRLock* mCounterLock; - PRMonitor* mEvilMonitor; - PRInt32 mCounter; - nsCOMPtr mThreadOne; - nsCOMPtr mThreadTwo; + private: + PRLock* mCounterLock; + PRMonitor* mEvilMonitor; + PRInt32 mCounter; + nsCOMPtr mThreadOne; + nsCOMPtr mThreadTwo; }; NS_IMPL_THREADSAFE_ADDREF(ProxyTest) NS_IMPL_THREADSAFE_RELEASE(ProxyTest) int -main(int argc, char **argv) + main(int argc, char **argv) { - NS_InitXPCOM2(nsnull, nsnull, nsnull); + NS_InitXPCOM2(nsnull, nsnull, nsnull); // Scope code so everything is destroyed before we run call NS_ShutdownXPCOM - { - nsCOMPtr registrar; - NS_GetComponentRegistrar(getter_AddRefs(registrar)); - registrar->AutoRegister(nsnull); + { + nsCOMPtr registrar; + NS_GetComponentRegistrar(getter_AddRefs(registrar)); + registrar->AutoRegister(nsnull); - nsCOMPtr tester = new ProxyTest(); - tester->Test(0, 0, nsnull); - } + nsCOMPtr tester = new ProxyTest(); + tester->Test(0, 0, nsnull); + } - NS_ShutdownXPCOM(nsnull); + NS_ShutdownXPCOM(nsnull); - return 0; + return 0; } diff --git a/xpcom/proxy/tests/proxytests.cpp b/xpcom/proxy/tests/proxytests.cpp index 7f95dc12a4fd..b644820cf2dd 100644 --- a/xpcom/proxy/tests/proxytests.cpp +++ b/xpcom/proxy/tests/proxytests.cpp @@ -61,14 +61,20 @@ #include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" +#include "testproxyclasses.h" + + #include "prlog.h" #ifdef PR_LOGGING -static PRLogModuleInfo *sLog = PR_NewLogModule("Test"); +PRLogModuleInfo *sLog = PR_NewLogModule("Test"); #define LOG(args) PR_LOG(sLog, PR_LOG_DEBUG, args) #else #define LOG(args) printf args #endif + + + namespace proxytests { static nsresult @@ -81,117 +87,9 @@ GetThreadFromPRThread(PRThread *prthread, nsIThread **result) return tm->GetThreadFromPRThread(prthread, result); } -/***************************************************************************/ -/* nsTestXPCFoo */ -/***************************************************************************/ -class nsTestXPCFoo : public nsITestProxy -{ - NS_DECL_ISUPPORTS - NS_IMETHOD Test(PRInt32 p1, PRInt32 p2, PRInt32* retval); - NS_IMETHOD Test2(); - NS_IMETHOD Test3(nsISupports *p1, nsISupports **p2); - nsTestXPCFoo(); -}; - -nsTestXPCFoo::nsTestXPCFoo() -{ - NS_ADDREF_THIS(); -} - -NS_IMPL_ISUPPORTS1(nsTestXPCFoo, nsITestProxy) - -NS_IMETHODIMP nsTestXPCFoo::Test(PRInt32 p1, PRInt32 p2, PRInt32* retval) -{ - LOG(("TEST: Thread (%d) Test Called successfully! Party on...\n", p1)); - *retval = p1+p2; - return NS_OK; -} - - -NS_IMETHODIMP nsTestXPCFoo::Test2() -{ - LOG(("TEST: The quick brown netscape jumped over the old lazy ie..\n")); - - return NS_OK; -} - -NS_IMETHODIMP nsTestXPCFoo::Test3(nsISupports *p1, nsISupports **p2) -{ - if (p1 != nsnull) - { - nsITestProxy *test; - - p1->QueryInterface(NS_GET_IID(nsITestProxy), (void**)&test); - - test->Test2(); - PRInt32 a; - test->Test( 1, 2, &a); - LOG(("TEST: \n1+2=%d\n",a)); - } - - - *p2 = new nsTestXPCFoo(); - return NS_OK; -} - -/***************************************************************************/ -/* nsTestXPCFoo2 */ -/***************************************************************************/ -class nsTestXPCFoo2 : public nsITestProxy -{ - NS_DECL_ISUPPORTS - NS_IMETHOD Test(PRInt32 p1, PRInt32 p2, PRInt32* retval); - NS_IMETHOD Test2(); - NS_IMETHOD Test3(nsISupports *p1, nsISupports **p2); - - nsTestXPCFoo2(); -}; - -nsTestXPCFoo2::nsTestXPCFoo2() -{ - NS_ADDREF_THIS(); -} - -NS_IMPL_THREADSAFE_ISUPPORTS1(nsTestXPCFoo2, nsITestProxy) - -NS_IMETHODIMP nsTestXPCFoo2::Test(PRInt32 p1, PRInt32 p2, PRInt32* retval) -{ - LOG(("TEST: calling back to caller!\n")); - - nsCOMPtr manager = - do_GetService(NS_XPCOMPROXY_CONTRACTID); - - LOG(("TEST: ProxyObjectManager: %p \n", (void *) manager.get())); - - PR_ASSERT(manager); - - nsCOMPtr thread; - GetThreadFromPRThread((PRThread *) p1, getter_AddRefs(thread)); - NS_ENSURE_STATE(thread); - - nsCOMPtr proxyObject; - manager->GetProxyForObject(thread, NS_GET_IID(nsITestProxy), this, NS_PROXY_SYNC, (void**)&proxyObject); - proxyObject->Test3(nsnull, nsnull); - - LOG(("TEST: Deleting Proxy Object\n")); - return NS_OK; -} - - -NS_IMETHODIMP nsTestXPCFoo2::Test2() -{ - LOG(("TEST: nsTestXPCFoo2::Test2() called\n")); - - return NS_OK; -} - - -NS_IMETHODIMP nsTestXPCFoo2::Test3(nsISupports *p1, nsISupports **p2) -{ - LOG(("TEST: Got called")); - return NS_OK; -} ++// I really do not like the forced SIMPLE_PROGRAMS Makefile paradigm ++#include "testproxyclasses.cpp" @@ -251,7 +149,6 @@ void TestCase_TwoClassesOneInterface(void *arg) rv = proxyObject->Test(threadNumber, 0, &a); printf("Thread (%d) error: %d.\n", threadNumber, rv); - printf("Thread (%d) Prior to calling proxyObject->Test2.\n", threadNumber); rv = proxyObject->Test2(); printf("Thread (%d) error: %d.\n", threadNumber, rv); @@ -272,21 +169,582 @@ void TestCase_TwoClassesOneInterface(void *arg) #endif +void TestCase_1_Failure() +{ + nsCOMPtr manager = + do_GetService(NS_XPCOMPROXY_CONTRACTID); + + LOG(("TestCase_1_Failure: ProxyObjectManager: %p\n", (void *) manager.get())); + + PR_ASSERT(manager); + + nsITestProxy *proxyObject; + nsTestXPCFoo* foo = new nsTestXPCFoo(); + + PR_ASSERT(foo); + + LOG(("TestCase_1_Failure: xsTestXPCFoo Object Created [0x%08X] => \n", foo)); + + PRInt32 a1; + nsresult rv, r; + + a1=10; + LOG(("TestCase_1_Failure: DIRECT 1_1: Entry: [%d] => \n", a1)); + printf("TestCase_1_Failure: DIRECT 1_1: Entry: [%d] => \n", a1); + rv = foo->Test1_1(&a1, &r); + LOG(("TestCase_1_Failure: DIRECT 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("TestCase_1_Failure: DIRECT 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv); + + + nsCOMPtr eventLoopThread; + NS_NewThread(getter_AddRefs(eventLoopThread)); + + PRThread *eventLoopPRThread; + eventLoopThread->GetPRThread(&eventLoopPRThread); + PR_ASSERT(eventLoopPRThread); + + nsCOMPtr thread; + GetThreadFromPRThread(eventLoopPRThread, getter_AddRefs(thread)); + + manager->GetProxyForObject(thread, NS_GET_IID(nsITestProxy), foo, NS_PROXY_SYNC, (void**)&proxyObject); + + LOG(("TestCase_1_Failure: Deleting real nsTestXPCFoo Object [0x%08X]\n", foo)); + NS_RELEASE(foo); + + if (proxyObject) + { + a1=10; + LOG(("TestCase_1_Failure: PROXY 1_1: Entry: [%d] => \n", a1)); + printf("TestCase_1_Failure: PROXY 1_1: Entry: [%d] => \n", a1); + rv = proxyObject->Test1_1(&a1, &r); + LOG(("TestCase_1_Failure: PROXY 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("TestCase_1_Failure: PROXY 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv); + + LOG(("TestCase_1_Failure: Deleting Proxy Object [0x%08X]\n", proxyObject)); + NS_RELEASE(proxyObject); + } + + PR_Sleep( PR_MillisecondsToInterval(1000) ); // If your thread goes away, your stack goes away. Only use ASYNC on calls that do not have out parameters +} + + +void TestCase_1_DirectTests(nsTestXPCFoo *foo) +{ + PRInt32 a1, b1, c1, d1, e1, f1, g1, h1, i1, j1; + nsresult rv, r; + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; h1=80; i1=90; j1=100; + LOG(("NestedLoop: DIRECT TEST 10_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1)); + printf("NestedLoop: DIRECT TEST 10_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1); + rv = foo->Test10_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &j1, &r); + LOG(("NestedLoop: DIRECT TEST 10_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv)); + printf("NestedLoop: DIRECT TEST 10_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; h1=80; i1=90; + LOG(("NestedLoop: DIRECT TEST 9_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1)); + printf("NestedLoop: DIRECT TEST 9_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1); + rv = foo->Test9_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &r); + LOG(("NestedLoop: DIRECT TEST 9_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv)); + printf("NestedLoop: DIRECT TEST 9_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; h1=80; + LOG(("NestedLoop: DIRECT TEST 8_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1)); + printf("NestedLoop: DIRECT TEST 8_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1); + rv = foo->Test8_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &r); + LOG(("NestedLoop: DIRECT TEST 8_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv)); + printf("NestedLoop: DIRECT TEST 8_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; + LOG(("NestedLoop: DIRECT TEST 7_1: Entry: [%d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1)); + printf("NestedLoop: DIRECT TEST 7_1: Entry: [%d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1); + rv = foo->Test7_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &r); + LOG(("NestedLoop: DIRECT TEST 7_1: Return: => [%d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv)); + printf("NestedLoop: DIRECT TEST 7_1: Return: => [%d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; + LOG(("NestedLoop: DIRECT TEST 6_1: Entry: [%d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1)); + printf("NestedLoop: DIRECT TEST 6_1: Entry: [%d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1); + rv = foo->Test6_1(&a1, &b1, &c1, &d1, &e1, &f1, &r); + LOG(("NestedLoop: DIRECT TEST 6_1: Return: => [%d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv)); + printf("NestedLoop: DIRECT TEST 6_1: Return: => [%d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; + LOG(("NestedLoop: DIRECT TEST 5_1: Entry: [%d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1)); + printf("NestedLoop: DIRECT TEST 5_1: Entry: [%d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1); + rv = foo->Test5_1(&a1, &b1, &c1, &d1, &e1, &r); + LOG(("NestedLoop: DIRECT TEST 5_1: Return: => [%d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv)); + printf("NestedLoop: DIRECT TEST 5_1: Return: => [%d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv); + + a1=10; b1=20; c1=30; d1=40; + LOG(("NestedLoop: DIRECT TEST 4_1: Entry: [%d, %d, %d, %d] => \n", a1, b1, c1, d1)); + printf("NestedLoop: DIRECT TEST 4_1: Entry: [%d, %d, %d, %d] => \n", a1, b1, c1, d1); + rv = foo->Test4_1(&a1, &b1, &c1, &d1, &r); + LOG(("NestedLoop: DIRECT TEST 4_1: Return: => [%d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv)); + printf("NestedLoop: DIRECT TEST 4_1: Return: => [%d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv); + + a1=10; b1=20; c1=30; + LOG(("NestedLoop: DIRECT TEST 3_1: Entry: [%d, %d, %d] => \n", a1, b1, c1)); + printf("NestedLoop: DIRECT TEST 3_1: Entry: [%d, %d, %d] => \n", a1, b1, c1); + rv = foo->Test3_1(&a1, &b1, &c1, &r); + LOG(("NestedLoop: DIRECT TEST 3_1: Return: => [%d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv)); + printf("NestedLoop: DIRECT TEST 3_1: Return: => [%d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv); + + a1=10; b1=20; + LOG(("NestedLoop: DIRECT TEST 2_1: Entry: [%d, %d] => \n", a1, b1)); + printf("NestedLoop: DIRECT TEST 2_1: Entry: [%d, %d] => \n", a1, b1); + rv = foo->Test2_1(&a1, &b1, &r); + LOG(("NestedLoop: DIRECT TEST 2_1: Return: => [%d, %d] --> Returns %d, rv=%d\n", a1, b1, r, rv)); + printf("NestedLoop: DIRECT TEST 2_1: Return: => [%d, %d] --> Returns %d, rv=%d\n", a1, b1, r, rv); + + a1=10; + LOG(("NestedLoop: DIRECT TEST 1_1: Entry: [%d] => \n", a1)); + printf("NestedLoop: DIRECT TEST 1_1: Entry: [%d] => \n", a1); + rv = foo->Test1_1(&a1, &r); + LOG(("NestedLoop: DIRECT TEST 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("NestedLoop: DIRECT TEST 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv); +} + + +void TestCase_1_ProxyTests(nsITestProxy *proxyObject) +{ + PRInt32 a1, b1, c1, d1, e1, f1, g1, h1, i1, j1; + nsresult rv, r; + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; h1=80; i1=90; j1=100; + LOG(("NestedLoop: TEST 10_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1)); + printf("NestedLoop: TEST 10_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1); + rv = proxyObject->Test10_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &j1, &r); + LOG(("NestedLoop: TEST 10_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv)); + printf("NestedLoop: TEST 10_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; h1=80; i1=90; + LOG(("NestedLoop: TEST 9_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1)); + printf("NestedLoop: TEST 9_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1); + rv = proxyObject->Test9_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &r); + LOG(("NestedLoop: TEST 9_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv)); + printf("NestedLoop: TEST 9_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; h1=80; + LOG(("NestedLoop: TEST 8_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1)); + printf("NestedLoop: TEST 8_1: Entry: [%d, %d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1, h1); + rv = proxyObject->Test8_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &r); + LOG(("NestedLoop: TEST 8_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv)); + printf("NestedLoop: TEST 8_1: Return: => [%d, %d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; g1=70; + LOG(("NestedLoop: TEST 7_1: Entry: [%d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1)); + printf("NestedLoop: TEST 7_1: Entry: [%d, %d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1, g1); + rv = proxyObject->Test7_1(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &r); + LOG(("NestedLoop: TEST 7_1: Return: => [%d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv)); + printf("NestedLoop: TEST 7_1: Return: => [%d, %d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; f1=60; + LOG(("NestedLoop: TEST 6_1: Entry: [%d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1)); + printf("NestedLoop: TEST 6_1: Entry: [%d, %d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1, f1); + rv = proxyObject->Test6_1(&a1, &b1, &c1, &d1, &e1, &f1, &r); + LOG(("NestedLoop: TEST 6_1: Return: => [%d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv)); + printf("NestedLoop: TEST 6_1: Return: => [%d, %d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv); + + a1=10; b1=20; c1=30; d1=40; e1=50; + LOG(("NestedLoop: TEST 5_1: Entry: [%d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1)); + printf("NestedLoop: TEST 5_1: Entry: [%d, %d, %d, %d, %d] => \n", a1, b1, c1, d1, e1); + rv = proxyObject->Test5_1(&a1, &b1, &c1, &d1, &e1, &r); + LOG(("NestedLoop: TEST 5_1: Return: => [%d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv)); + printf("NestedLoop: TEST 5_1: Return: => [%d, %d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv); + + a1=10; b1=20; c1=30; d1=40; + LOG(("NestedLoop: TEST 4_1: Entry: [%d, %d, %d, %d] => \n", a1, b1, c1, d1)); + printf("NestedLoop: TEST 4_1: Entry: [%d, %d, %d, %d] => \n", a1, b1, c1, d1); + rv = proxyObject->Test4_1(&a1, &b1, &c1, &d1, &r); + LOG(("NestedLoop: TEST 4_1: Return: => [%d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv)); + printf("NestedLoop: TEST 4_1: Return: => [%d, %d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv); + + a1=10; b1=20; c1=30; + LOG(("NestedLoop: TEST 3_1: Entry: [%d, %d, %d] => \n", a1, b1, c1)); + printf("NestedLoop: TEST 3_1: Entry: [%d, %d, %d] => \n", a1, b1, c1); + rv = proxyObject->Test3_1(&a1, &b1, &c1, &r); + LOG(("NestedLoop: TEST 3_1: Return: => [%d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv)); + printf("NestedLoop: TEST 3_1: Return: => [%d, %d, %d] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv); + + a1=10; b1=20; + LOG(("NestedLoop: TEST 2_1: Entry: [%d, %d] => \n", a1, b1)); + printf("NestedLoop: TEST 2_1: Entry: [%d, %d] => \n", a1, b1); + rv = proxyObject->Test2_1(&a1, &b1, &r); + LOG(("NestedLoop: TEST 2_1: Return: => [%d, %d] --> Returns %d, rv=%d\n", a1, b1, r, rv)); + printf("NestedLoop: TEST 2_1: Return: => [%d, %d] --> Returns %d, rv=%d\n", a1, b1, r, rv); + + a1=10; + LOG(("NestedLoop: TEST 1_1: Entry: [%d] => \n", a1)); + printf("NestedLoop: TEST 1_1: Entry: [%d] => \n", a1); + rv = proxyObject->Test1_1(&a1, &r); + LOG(("NestedLoop: TEST 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("NestedLoop: TEST 1_1: Return: => [%d] --> Returns %d, rv=%d\n", a1, r, rv); +} + + +void TestCase_2_ProxyTests(nsITestProxy *proxyObject) +{ + PRInt64 a1, b1, c1, d1, e1, f1, g1, h1, i1, j1; + nsresult rv, r; + a1=100; b1=200; c1=300; d1=400; e1=500; f1=600; g1=700; h1=800; i1=900; j1=1000; + LOG(("NestedLoop: TEST 10_2: Entry: [%g, %g, %g, %g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1)); + printf("NestedLoop: TEST 10_2: Entry: [%g, %g, %g, %g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1); + rv = proxyObject->Test10_2(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &j1, &r); + LOG(("NestedLoop: TEST 10_2: Return: => [%g, %g, %g, %g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv)); + printf("NestedLoop: TEST 10_2: Return: => [%g, %g, %g, %g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv); + + a1=100; b1=200; c1=300; d1=400; e1=500; f1=600; g1=700; h1=800; i1=900; + LOG(("NestedLoop: TEST 9_2: Entry: [%g, %g, %g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1)); + printf("NestedLoop: TEST 9_2: Entry: [%g, %g, %g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1); + rv = proxyObject->Test9_2(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &r); + LOG(("NestedLoop: TEST 9_2: Return: => [%g, %g, %g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv)); + printf("NestedLoop: TEST 9_2: Return: => [%g, %g, %g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv); + + a1=100; b1=200; c1=300; d1=400; e1=500; f1=600; g1=700; h1=800; + LOG(("NestedLoop: TEST 8_2: Entry: [%g, %g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1, h1)); + printf("NestedLoop: TEST 8_2: Entry: [%g, %g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1, h1); + rv = proxyObject->Test8_2(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &r); + LOG(("NestedLoop: TEST 8_2: Return: => [%g, %g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv)); + printf("NestedLoop: TEST 8_2: Return: => [%g, %g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv); + + a1=100; b1=200; c1=300; d1=400; e1=500; f1=600; g1=700; + LOG(("NestedLoop: TEST 7_2: Entry: [%g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1)); + printf("NestedLoop: TEST 7_2: Entry: [%g, %g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1, g1); + rv = proxyObject->Test7_2(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &r); + LOG(("NestedLoop: TEST 7_2: Return: => [%g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv)); + printf("NestedLoop: TEST 7_2: Return: => [%g, %g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv); + + a1=100; b1=200; c1=300; d1=400; e1=500; f1=600; + LOG(("NestedLoop: TEST 6_2: Entry: [%g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1)); + printf("NestedLoop: TEST 6_2: Entry: [%g, %g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1, f1); + rv = proxyObject->Test6_2(&a1, &b1, &c1, &d1, &e1, &f1, &r); + LOG(("NestedLoop: TEST 6_2: Return: => [%g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv)); + printf("NestedLoop: TEST 6_2: Return: => [%g, %g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv); + + a1=100; b1=200; c1=300; d1=400; e1=500; + LOG(("NestedLoop: TEST 5_2: Entry: [%g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1)); + printf("NestedLoop: TEST 5_2: Entry: [%g, %g, %g, %g, %g] => \n", a1, b1, c1, d1, e1); + rv = proxyObject->Test5_2(&a1, &b1, &c1, &d1, &e1, &r); + LOG(("NestedLoop: TEST 5_2: Return: => [%g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv)); + printf("NestedLoop: TEST 5_2: Return: => [%g, %g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv); + + a1=100; b1=200; c1=300; d1=400; + LOG(("NestedLoop: TEST 4_2: Entry: [%g, %g, %g, %g] => \n", a1, b1, c1, d1)); + printf("NestedLoop: TEST 4_2: Entry: [%g, %g, %g, %g] => \n", a1, b1, c1, d1); + rv = proxyObject->Test4_2(&a1, &b1, &c1, &d1, &r); + LOG(("NestedLoop: TEST 4_2: Return: => [%g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv)); + printf("NestedLoop: TEST 4_2: Return: => [%g, %g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv); + + a1=100; b1=200; c1=300; + LOG(("NestedLoop: TEST 3_2: Entry: [%g, %g, %g] => \n", a1, b1, c1)); + printf("NestedLoop: TEST 3_2: Entry: [%g, %g, %g] => \n", a1, b1, c1); + rv = proxyObject->Test3_2(&a1, &b1, &c1, &r); + LOG(("NestedLoop: TEST 3_2: Return: => [%g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv)); + printf("NestedLoop: TEST 3_2: Return: => [%g, %g, %g] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv); + + a1=100; b1=200; + LOG(("NestedLoop: TEST 2_2: Entry: [%g, %g] => \n", a1, b1)); + printf("NestedLoop: TEST 2_2: Entry: [%g, %g] => \n", a1, b1); + rv = proxyObject->Test2_2(&a1, &b1, &r); + LOG(("NestedLoop: TEST 2_2: Return: => [%g, %g] --> Returns %d, rv=%d\n", a1, b1, r, rv)); + printf("NestedLoop: TEST 2_2: Return: => [%g, %g] --> Returns %d, rv=%d\n", a1, b1, r, rv); + + a1=100; + LOG(("NestedLoop: TEST 1_2: Entry: [%g] => \n", a1)); + printf("NestedLoop: TEST 1_2: Entry: [%g] => \n", a1); + rv = proxyObject->Test1_2(&a1, &r); + LOG(("NestedLoop: TEST 1_2: Return: => [%g] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("NestedLoop: TEST 1_2: Return: => [%g] --> Returns %d, rv=%d\n", a1, r, rv); +} + + +void TestCase_3_ProxyTests(nsITestProxy *proxyObject) +{ + float a1, b1, c1, d1, e1, f1, g1, h1, i1, j1; + nsresult rv, r; + a1=10.0; b1=20.0; c1=30.0; d1=40.0; e1=50.0; f1=60.0; g1=70.0; h1=80.0; i1=90.0; j1=100.0; + LOG(("NestedLoop: TEST 10_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1)); + printf("NestedLoop: TEST 10_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1); + rv = proxyObject->Test10_3(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &j1, &r); + LOG(("NestedLoop: TEST 10_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv)); + printf("NestedLoop: TEST 10_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; d1=40.0; e1=50.0; f1=60.0; g1=70.0; h1=80.0; i1=90.0; + LOG(("NestedLoop: TEST 9_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1)); + printf("NestedLoop: TEST 9_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1); + rv = proxyObject->Test9_3(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &r); + LOG(("NestedLoop: TEST 9_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv)); + printf("NestedLoop: TEST 9_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; d1=40.0; e1=50.0; f1=60.0; g1=70.0; h1=80.0; + LOG(("NestedLoop: TEST 8_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1, h1)); + printf("NestedLoop: TEST 8_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1, h1); + rv = proxyObject->Test8_3(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &r); + LOG(("NestedLoop: TEST 8_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv)); + printf("NestedLoop: TEST 8_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; d1=40.0; e1=50.0; f1=60.0; g1=70.0; + LOG(("NestedLoop: TEST 7_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1)); + printf("NestedLoop: TEST 7_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1, g1); + rv = proxyObject->Test7_3(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &r); + LOG(("NestedLoop: TEST 7_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv)); + printf("NestedLoop: TEST 7_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; d1=40.0; e1=50.0; f1=60.0; + LOG(("NestedLoop: TEST 6_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1)); + printf("NestedLoop: TEST 6_3: Entry: [%lf, %lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1, f1); + rv = proxyObject->Test6_3(&a1, &b1, &c1, &d1, &e1, &f1, &r); + LOG(("NestedLoop: TEST 6_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv)); + printf("NestedLoop: TEST 6_3: Return: => [%lf, %lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; d1=40.0; e1=50.0; + LOG(("NestedLoop: TEST 5_3: Entry: [%lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1)); + printf("NestedLoop: TEST 5_3: Entry: [%lf, %lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1, e1); + rv = proxyObject->Test5_3(&a1, &b1, &c1, &d1, &e1, &r); + LOG(("NestedLoop: TEST 5_3: Return: => [%lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv)); + printf("NestedLoop: TEST 5_3: Return: => [%lf, %lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; d1=40.0; + LOG(("NestedLoop: TEST 4_3: Entry: [%lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1)); + printf("NestedLoop: TEST 4_3: Entry: [%lf, %lf, %lf, %lf] => \n", a1, b1, c1, d1); + rv = proxyObject->Test4_3(&a1, &b1, &c1, &d1, &r); + LOG(("NestedLoop: TEST 4_3: Return: => [%lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv)); + printf("NestedLoop: TEST 4_3: Return: => [%lf, %lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv); + + a1=10.0; b1=20.0; c1=30.0; + LOG(("NestedLoop: TEST 3_3: Entry: [%lf, %lf, %lf] => \n", a1, b1, c1)); + printf("NestedLoop: TEST 3_3: Entry: [%lf, %lf, %lf] => \n", a1, b1, c1); + rv = proxyObject->Test3_3(&a1, &b1, &c1, &r); + LOG(("NestedLoop: TEST 3_3: Return: => [%lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv)); + printf("NestedLoop: TEST 3_3: Return: => [%lf, %lf, %lf] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv); + + a1=10.0; b1=20.0; + LOG(("NestedLoop: TEST 2_3: Entry: [%lf, %lf] => \n", a1, b1)); + printf("NestedLoop: TEST 2_3: Entry: [%lf, %lf] => \n", a1, b1); + rv = proxyObject->Test2_3(&a1, &b1, &r); + LOG(("NestedLoop: TEST 2_3: Return: => [%lf, %lf] --> Returns %d, rv=%d\n", a1, b1, r, rv)); + printf("NestedLoop: TEST 2_3: Return: => [%lf, %lf] --> Returns %d, rv=%d\n", a1, b1, r, rv); + + a1=10.0; + LOG(("NestedLoop: TEST 1_3: Entry: [%lf] => \n", a1)); + printf("NestedLoop: TEST 1_3: Entry: [%lf] => \n", a1); + rv = proxyObject->Test1_3(&a1, &r); + LOG(("NestedLoop: TEST 1_3: Return: => [%lf] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("NestedLoop: TEST 1_3: Return: => [%lf] --> Returns %d, rv=%d\n", a1, r, rv); +} + + +void TestCase_4_ProxyTests(nsITestProxy *proxyObject) +{ + double a1, b1, c1, d1, e1, f1, g1, h1, i1, j1; + nsresult rv, r; + a1=100.0; b1=200.0; c1=300.0; d1=400.0; e1=500.0; f1=600.0; g1=700.0; h1=800.0; i1=900.0; j1=1000.0; + LOG(("NestedLoop: TEST 10_4: Entry: [%le, %le, %le, %le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1)); + printf("NestedLoop: TEST 10_4: Entry: [%le, %le, %le, %le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1); + rv = proxyObject->Test10_4(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &j1, &r); + LOG(("NestedLoop: TEST 10_4: Return: => [%le, %le, %le, %le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv)); + printf("NestedLoop: TEST 10_4: Return: => [%le, %le, %le, %le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; d1=400.0; e1=500.0; f1=600.0; g1=700.0; h1=800.0; i1=900.0; + LOG(("NestedLoop: TEST 9_4: Entry: [%le, %le, %le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1)); + printf("NestedLoop: TEST 9_4: Entry: [%le, %le, %le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1, h1, i1); + rv = proxyObject->Test9_4(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &i1, &r); + LOG(("NestedLoop: TEST 9_4: Return: => [%le, %le, %le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv)); + printf("NestedLoop: TEST 9_4: Return: => [%le, %le, %le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, i1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; d1=400.0; e1=500.0; f1=600.0; g1=700.0; h1=800.0; + LOG(("NestedLoop: TEST 8_4: Entry: [%le, %le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1, h1)); + printf("NestedLoop: TEST 8_4: Entry: [%le, %le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1, h1); + rv = proxyObject->Test8_4(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &h1, &r); + LOG(("NestedLoop: TEST 8_4: Return: => [%le, %le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv)); + printf("NestedLoop: TEST 8_4: Return: => [%le, %le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, h1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; d1=400.0; e1=500.0; f1=600.0; g1=700.0; + LOG(("NestedLoop: TEST 7_4: Entry: [%le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1)); + printf("NestedLoop: TEST 7_4: Entry: [%le, %le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1, g1); + rv = proxyObject->Test7_4(&a1, &b1, &c1, &d1, &e1, &f1, &g1, &r); + LOG(("NestedLoop: TEST 7_4: Return: => [%le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv)); + printf("NestedLoop: TEST 7_4: Return: => [%le, %le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, g1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; d1=400.0; e1=500.0; f1=600.0; + LOG(("NestedLoop: TEST 6_4: Entry: [%le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1)); + printf("NestedLoop: TEST 6_4: Entry: [%le, %le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1, f1); + rv = proxyObject->Test6_4(&a1, &b1, &c1, &d1, &e1, &f1, &r); + LOG(("NestedLoop: TEST 6_4: Return: => [%le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv)); + printf("NestedLoop: TEST 6_4: Return: => [%le, %le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, f1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; d1=400.0; e1=500.0; + LOG(("NestedLoop: TEST 5_4: Entry: [%le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1)); + printf("NestedLoop: TEST 5_4: Entry: [%le, %le, %le, %le, %le] => \n", a1, b1, c1, d1, e1); + rv = proxyObject->Test5_4(&a1, &b1, &c1, &d1, &e1, &r); + LOG(("NestedLoop: TEST 5_4: Return: => [%le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv)); + printf("NestedLoop: TEST 5_4: Return: => [%le, %le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, e1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; d1=400.0; + LOG(("NestedLoop: TEST 4_4: Entry: [%le, %le, %le, %le] => \n", a1, b1, c1, d1)); + printf("NestedLoop: TEST 4_4: Entry: [%le, %le, %le, %le] => \n", a1, b1, c1, d1); + rv = proxyObject->Test4_4(&a1, &b1, &c1, &d1, &r); + LOG(("NestedLoop: TEST 4_4: Return: => [%le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv)); + printf("NestedLoop: TEST 4_4: Return: => [%le, %le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, d1, r, rv); + + a1=100.0; b1=200.0; c1=300.0; + LOG(("NestedLoop: TEST 3_4: Entry: [%le, %le, %le] => \n", a1, b1, c1)); + printf("NestedLoop: TEST 3_4: Entry: [%le, %le, %le] => \n", a1, b1, c1); + rv = proxyObject->Test3_4(&a1, &b1, &c1, &r); + LOG(("NestedLoop: TEST 3_4: Return: => [%le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv)); + printf("NestedLoop: TEST 3_4: Return: => [%le, %le, %le] --> Returns %d, rv=%d\n", a1, b1, c1, r, rv); + + a1=100.0; b1=200.0; + LOG(("NestedLoop: TEST 2_4: Entry: [%le, %le] => \n", a1, b1)); + printf("NestedLoop: TEST 2_4: Entry: [%le, %le] => \n", a1, b1); + rv = proxyObject->Test2_4(&a1, &b1, &r); + LOG(("NestedLoop: TEST 2_4: Return: => [%le, %le] --> Returns %d, rv=%d\n", a1, b1, r, rv)); + printf("NestedLoop: TEST 2_4: Return: => [%le, %le] --> Returns %d, rv=%d\n", a1, b1, r, rv); + + a1=100.0; + LOG(("NestedLoop: TEST 1_4: Entry: [%le] => \n", a1)); + printf("NestedLoop: TEST 1_4: Entry: [%le] => \n", a1); + rv = proxyObject->Test1_4(&a1, &r); + LOG(("NestedLoop: TEST 1_4: Return: => [%le] --> Returns %d, rv=%d\n", a1, r, rv)); + printf("NestedLoop: TEST 1_4: Return: => [%le] --> Returns %d, rv=%d\n", a1, r, rv); +} + + +void TestCase_5_ProxyTests(nsITestProxy *proxyObject) +{ + //nsITestProxy *p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10; + nsISupports *p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10; + p1 = p2 = p3 = p4 = p5 = p6 = p7 = p8 = p9 = p10 = NULL; + nsresult rv, r; + + printf("\n\nNestedLoop: TestCase_5_ProxyTests: **** NOTE **** You can verify that the sub-tests of TEST 1_5 worked by looking at the \\NSPR.LOG file on your device!\n\n"); + + LOG(("NestedLoop: TEST 1_5: Entry: [0x%08X] => \n", + p1)); + printf("NestedLoop: TEST 1_5: Entry: [0x%08X] => \n", + p1); + rv = proxyObject->Test1_5(&p1, &r); + LOG(("NestedLoop: TEST 1_5: Return: => [0x%08X] --> Returns %d, rv=%d\n", + p1, r, rv)); + printf("NestedLoop: TEST 1_5: Return: => [0x%08X] --> Returns %d, rv=%d\n", + p1, r, rv); + + LOG(("NestedLoop: TEST 2_5: Entry: [0x%08X, 0x%08X] => \n", + p1, p2)); + printf("NestedLoop: TEST 2_5: Entry: [0x%08X, 0x%08X] => \n", + p1, p2); + rv = proxyObject->Test2_5(&p1, &p2, &r); + LOG(("NestedLoop: TEST 2_5: Return: => [0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, r, rv)); + printf("NestedLoop: TEST 2_5: Return: => [0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, r, rv); + + LOG(("NestedLoop: TEST 3_5: Entry: [0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3)); + printf("NestedLoop: TEST 3_5: Entry: [0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3); + rv = proxyObject->Test3_5(&p1, &p2, &p3, &r); + LOG(("NestedLoop: TEST 3_5: Return: => [0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, r, rv)); + printf("NestedLoop: TEST 3_5: Return: => [0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, r, rv); + + LOG(("NestedLoop: TEST 4_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4)); + printf("NestedLoop: TEST 4_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4); + rv = proxyObject->Test4_5(&p1, &p2, &p3, &p4, &r); + LOG(("NestedLoop: TEST 4_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, r, rv)); + printf("NestedLoop: TEST 4_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, r, rv); + + LOG(("NestedLoop: TEST 5_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5)); + printf("NestedLoop: TEST 5_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5); + rv = proxyObject->Test5_5(&p1, &p2, &p3, &p4, &p5, &r); + LOG(("NestedLoop: TEST 5_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, r, rv)); + printf("NestedLoop: TEST 5_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, r, rv); + + LOG(("NestedLoop: TEST 6_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6)); + printf("NestedLoop: TEST 6_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6); + rv = proxyObject->Test6_5(&p1, &p2, &p3, &p4, &p5, &p6, &r); + LOG(("NestedLoop: TEST 6_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, r, rv)); + printf("NestedLoop: TEST 6_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, r, rv); + + LOG(("NestedLoop: TEST 7_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7)); + printf("NestedLoop: TEST 7_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7); + rv = proxyObject->Test7_5(&p1, &p2, &p3, &p4, &p5, &p6, &p7, &r); + LOG(("NestedLoop: TEST 7_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, r, rv)); + printf("NestedLoop: TEST 7_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, r, rv); + + LOG(("NestedLoop: TEST 8_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7, p8)); + printf("NestedLoop: TEST 8_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7, p8); + rv = proxyObject->Test8_5(&p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &r); + LOG(("NestedLoop: TEST 8_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, p8, r, rv)); + printf("NestedLoop: TEST 8_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, p8, r, rv); + + LOG(("NestedLoop: TEST 9_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7, p8, p9)); + printf("NestedLoop: TEST 9_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7, p8, p9); + rv = proxyObject->Test9_5(&p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &p9, &r); + LOG(("NestedLoop: TEST 9_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, p8, p9, r, rv)); + printf("NestedLoop: TEST 9_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, p8, p9, r, rv); + + LOG(("NestedLoop: TEST 10_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)); + printf("NestedLoop: TEST 10_5: Entry: [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] => \n", + p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); + rv = proxyObject->Test10_5(&p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &p9, &p10, &r); + LOG(("NestedLoop: TEST 10_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, r, rv)); + printf("NestedLoop: TEST 10_5: Return: => [0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X] --> Returns %d, rv=%d\n", + p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, r, rv); + + NS_RELEASE(p10); + NS_RELEASE(p9); + NS_RELEASE(p8); + NS_RELEASE(p7); + NS_RELEASE(p6); + NS_RELEASE(p5); + NS_RELEASE(p4); + NS_RELEASE(p3); + NS_RELEASE(p2); + NS_RELEASE(p1); +} + void TestCase_NestedLoop(nsIThread *thread, PRInt32 index) { nsCOMPtr manager = do_GetService(NS_XPCOMPROXY_CONTRACTID); - LOG(("TEST: ProxyObjectManager: %p\n", (void *) manager.get())); + LOG(("NestedLoop: ProxyObjectManager: %p\n", (void *) manager.get())); PR_ASSERT(manager); nsITestProxy *proxyObject; - nsTestXPCFoo2* foo = new nsTestXPCFoo2(); + nsTestXPCFoo* foo = new nsTestXPCFoo(); PR_ASSERT(foo); + TestCase_1_DirectTests(foo); manager->GetProxyForObject(thread, NS_GET_IID(nsITestProxy), foo, NS_PROXY_SYNC, (void**)&proxyObject); @@ -296,24 +754,33 @@ void TestCase_NestedLoop(nsIThread *thread, PRInt32 index) nsresult rv; - LOG(("TEST: Deleting real Object (%d)\n", index)); + LOG(("NestedLoop: Deleting real Object (%d)\n", index)); NS_RELEASE(foo); PRInt32 retval; - LOG(("TEST: Getting EventThread...\n")); + LOG(("NestedLoop: Getting EventThread...\n")); //nsCOMPtr curThread = do_GetCurrentThread(); PRThread *curThread = PR_GetCurrentThread(); if (curThread) { - LOG(("TEST: Thread (%d) Prior to calling proxyObject->Test.\n", index)); + LOG(("NestedLoop: Thread (%d) Prior to calling proxyObject->Test.\n", index)); rv = proxyObject->Test(NS_PTR_TO_INT32((void*)curThread), 0, &retval); // XXX broken on 64-bit arch - LOG(("TEST: Thread (%d) proxyObject error: %x.\n", index, rv)); + LOG(("NestedLoop: Thread (%d) proxyObject error: %x.\n", index, rv)); - LOG(("TEST: Deleting Proxy Object (%d)\n", index)); - NS_RELEASE(proxyObject); - } + } else { + LOG(("NestedLoop: No EventThread Found!\n")); + } + + TestCase_1_ProxyTests(proxyObject); + TestCase_2_ProxyTests(proxyObject); + TestCase_3_ProxyTests(proxyObject); + TestCase_4_ProxyTests(proxyObject); + TestCase_5_ProxyTests(proxyObject); + + LOG(("NestedLoop: Deleting Proxy Object (%d)\n", index)); + NS_RELEASE(proxyObject); PR_Sleep( PR_MillisecondsToInterval(1000) ); // If your thread goes away, your stack goes away. Only use ASYNC on calls that do not have out parameters } @@ -411,7 +878,9 @@ public: PRInt32 a; proxyObject->Test(1, 2, &a); - proxyObject->Test2(); + + nsresult rv; + proxyObject->Test2(&rv); NS_RELEASE(proxyObject); delete foo; @@ -492,13 +961,11 @@ RunApartmentTest() using namespace proxytests; -int -main(int argc, char **argv) +int do_my_test(int numberOfThreads) { - int numberOfThreads = 1; - if (argc > 1) - numberOfThreads = atoi(argv[1]); + if ( sLog == NULL ) + sLog = PR_NewLogModule("Test"); NS_InitXPCOM2(nsnull, nsnull, nsnull); @@ -508,13 +975,15 @@ main(int argc, char **argv) NS_GetComponentRegistrar(getter_AddRefs(registrar)); registrar->AutoRegister(nsnull); - RunApartmentTest(); - +#if 0 + TestCase_1_Failure(); +#else nsCOMPtr eventLoopThread; NS_NewThread(getter_AddRefs(eventLoopThread)); - nsCOMPtr test = new TestSyncProxyToSelf(); - eventLoopThread->Dispatch(test, NS_DISPATCH_NORMAL); + nsCOMPtr test; + //test = new TestSyncProxyToSelf(); + //eventLoopThread->Dispatch(test, NS_DISPATCH_NORMAL); PRThread *eventLoopPRThread; eventLoopThread->GetPRThread(&eventLoopPRThread); @@ -548,6 +1017,8 @@ main(int argc, char **argv) LOG(("TEST: Shutting down event loop thread\n")); eventLoopThread->Shutdown(); +#endif + } LOG(("TEST: Calling Cleanup.\n")); @@ -556,3 +1027,28 @@ main(int argc, char **argv) LOG(("TEST: Return zero.\n")); return 0; } + + + +int + main(void *myThis, int argc, char **argv) +{ + int numberOfThreads = 1; + + if (argc > 1) + numberOfThreads = atoi(argv[1]); + + return do_my_test(numberOfThreads); +} + + + + + + +LRESULT APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) +{ + do_my_test(1); + + return 0; +} diff --git a/xpcom/reflect/xptcall/src/md/win32/xptc_arm_ceppc.asm b/xpcom/reflect/xptcall/src/md/win32/xptc_arm_ceppc.asm index 396c1916ac40..71e62ab56034 100644 --- a/xpcom/reflect/xptcall/src/md/win32/xptc_arm_ceppc.asm +++ b/xpcom/reflect/xptcall/src/md/win32/xptc_arm_ceppc.asm @@ -287,9 +287,8 @@ $FuncName PROC ; the result is in r0 - ldr r0, [sp] ; Start unwinding the stack + str r0, [sp] ; Start unwinding the stack str r0, [sp, #0x20] - ldr r0, [sp, #0x20] ; 225 : }