adding forward declaration test

This commit is contained in:
jband%netscape.com 1999-07-16 20:38:16 +00:00
Родитель 7972332b69
Коммит 5cf8d696a6
4 изменённых файлов: 51 добавлений и 0 удалений

Просмотреть файл

@ -1,7 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
#include "xpcexception.idl"
// forward declaration (to test that such things work)
interface nsITestXPCSomeUselessThing;
[scriptable, uuid(159E36D0-991E-11d2-AC3F-00C09300144B)]
interface nsITestXPCFoo : nsISupports {
long Test(in long p1, in long p2);
@ -80,6 +100,8 @@ interface nsIEcho : nsISupports {
nsIJSStackFrameLocation GetStack();
void SetReceiverReturnOldReceiver(inout nsIEcho aReceiver);
void MethodWithForwardDeclaredParam(in nsITestXPCSomeUselessThing sut);
};
/***************************************************************************/

Просмотреть файл

@ -274,6 +274,9 @@ public:
/* void SetReceiverReturnOldReceiver (inout nsIEcho aReceiver); */
NS_IMETHOD SetReceiverReturnOldReceiver(nsIEcho **aReceiver);
/* void MethodWithForwardDeclaredParam (in nsITestXPCSomeUselessThing sut); */
NS_IMETHOD MethodWithForwardDeclaredParam(nsITestXPCSomeUselessThing *sut);
MyEcho();
private:
nsIEcho* mReceiver;
@ -512,6 +515,13 @@ MyEcho::SetReceiverReturnOldReceiver(nsIEcho **aReceiver)
return NS_OK;
}
/* void MethodWithForwardDeclaredParam (in nsITestXPCSomeUselessThing sut); */
NS_IMETHODIMP
MyEcho::MethodWithForwardDeclaredParam(nsITestXPCSomeUselessThing *sut)
{
return NS_OK;
}
/***************************************************************************/
// security manager test class

Просмотреть файл

@ -99,6 +99,9 @@ public:
/* void SetReceiverReturnOldReceiver (inout nsIEcho aReceiver); */
NS_IMETHOD SetReceiverReturnOldReceiver(nsIEcho **aReceiver);
/* void MethodWithForwardDeclaredParam (in nsITestXPCSomeUselessThing sut); */
NS_IMETHOD MethodWithForwardDeclaredParam(nsITestXPCSomeUselessThing *sut);
xpctestEcho();
private:
nsIEcho* mReceiver;
@ -335,6 +338,13 @@ xpctestEcho::SetReceiverReturnOldReceiver(nsIEcho **aReceiver)
return NS_OK;
}
/* void MethodWithForwardDeclaredParam (in nsITestXPCSomeUselessThing sut); */
NS_IMETHODIMP
xpctestEcho::MethodWithForwardDeclaredParam(nsITestXPCSomeUselessThing *sut)
{
return NS_OK;
}
/***************************************************************************/
// static

Просмотреть файл

@ -468,6 +468,15 @@ print("inout of interface tests - "+
(all_ok ? "passed" : "failed"));
echo.SetReceiver(null);
/***************************************************************************/
try {
echo.MethodWithForwardDeclaredParam(new Object());
print("method with forward declared param test - passed");
} catch(e) {
print("method with forward declared param test - failed");
}
/***************************************************************************/
// Components object test...
// print(".......................................");