2009-10-19 19:12:25 -07:00
|
|
|
#include "TestDesc.h"
|
|
|
|
|
|
|
|
#include "IPDLUnitTests.h" // fail etc.
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace _ipdltest {
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// parent
|
|
|
|
void
|
|
|
|
TestDescParent::Main()
|
|
|
|
{
|
2010-05-22 12:35:34 -07:00
|
|
|
PTestDescSubParent* p = CallPTestDescSubConstructor(0);
|
2009-10-19 19:12:25 -07:00
|
|
|
if (!p)
|
|
|
|
fail("can't allocate Sub");
|
|
|
|
|
2010-05-22 12:35:34 -07:00
|
|
|
PTestDescSubsubParent* pp = p->CallPTestDescSubsubConstructor();
|
2009-10-19 19:12:25 -07:00
|
|
|
if (!pp)
|
|
|
|
fail("can't allocate Subsub");
|
|
|
|
|
|
|
|
if (!SendTest(pp))
|
|
|
|
fail("can't send Subsub");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
TestDescParent::RecvOk(PTestDescSubsubParent* a)
|
|
|
|
{
|
|
|
|
if (!a)
|
|
|
|
fail("didn't receive Subsub");
|
|
|
|
|
2010-05-22 12:35:34 -07:00
|
|
|
if (!PTestDescSubsubParent::Call__delete__(a))
|
|
|
|
fail("deleting Subsub");
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
Close();
|
2009-10-19 19:12:25 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PTestDescSubParent*
|
2010-05-22 12:35:34 -07:00
|
|
|
TestDescParent::AllocPTestDescSub(PTestDescSubsubParent* dummy) {
|
|
|
|
if (dummy)
|
|
|
|
fail("actor supposed to be null");
|
2009-10-19 19:12:25 -07:00
|
|
|
return new TestDescSubParent();
|
|
|
|
}
|
|
|
|
bool
|
|
|
|
TestDescParent::DeallocPTestDescSub(PTestDescSubParent* actor)
|
|
|
|
{
|
|
|
|
delete actor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PTestDescSubsubParent*
|
|
|
|
TestDescSubParent::AllocPTestDescSubsub()
|
|
|
|
{
|
|
|
|
return new TestDescSubsubParent();
|
|
|
|
}
|
|
|
|
bool
|
|
|
|
TestDescSubParent::DeallocPTestDescSubsub(PTestDescSubsubParent* actor)
|
|
|
|
{
|
|
|
|
delete actor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// child
|
|
|
|
|
|
|
|
bool
|
|
|
|
TestDescChild::RecvTest(PTestDescSubsubChild* a)
|
|
|
|
{
|
|
|
|
if (!a)
|
|
|
|
fail("didn't receive Subsub");
|
|
|
|
if (!SendOk(a))
|
|
|
|
fail("couldn't send Ok()");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PTestDescSubChild*
|
2010-05-22 12:35:34 -07:00
|
|
|
TestDescChild::AllocPTestDescSub(PTestDescSubsubChild* dummy) {
|
|
|
|
if (dummy)
|
|
|
|
fail("actor supposed to be null");
|
2009-10-19 19:12:25 -07:00
|
|
|
return new TestDescSubChild();
|
|
|
|
}
|
|
|
|
bool
|
|
|
|
TestDescChild::DeallocPTestDescSub(PTestDescSubChild* actor)
|
|
|
|
{
|
|
|
|
delete actor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PTestDescSubsubChild*
|
|
|
|
TestDescSubChild::AllocPTestDescSubsub()
|
|
|
|
{
|
|
|
|
return new TestDescSubsubChild();
|
|
|
|
}
|
|
|
|
bool
|
|
|
|
TestDescSubChild::DeallocPTestDescSubsub(PTestDescSubsubChild* actor)
|
|
|
|
{
|
|
|
|
delete actor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace _ipdltest
|
|
|
|
} // namespace mozilla
|