Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | #include "TestDesc.h" |
michael@0 | 2 | |
michael@0 | 3 | #include "IPDLUnitTests.h" // fail etc. |
michael@0 | 4 | |
michael@0 | 5 | namespace mozilla { |
michael@0 | 6 | namespace _ipdltest { |
michael@0 | 7 | |
michael@0 | 8 | //----------------------------------------------------------------------------- |
michael@0 | 9 | // parent |
michael@0 | 10 | void |
michael@0 | 11 | TestDescParent::Main() |
michael@0 | 12 | { |
michael@0 | 13 | PTestDescSubParent* p = CallPTestDescSubConstructor(0); |
michael@0 | 14 | if (!p) |
michael@0 | 15 | fail("can't allocate Sub"); |
michael@0 | 16 | |
michael@0 | 17 | PTestDescSubsubParent* pp = p->CallPTestDescSubsubConstructor(); |
michael@0 | 18 | if (!pp) |
michael@0 | 19 | fail("can't allocate Subsub"); |
michael@0 | 20 | |
michael@0 | 21 | if (!SendTest(pp)) |
michael@0 | 22 | fail("can't send Subsub"); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | bool |
michael@0 | 26 | TestDescParent::RecvOk(PTestDescSubsubParent* a) |
michael@0 | 27 | { |
michael@0 | 28 | if (!a) |
michael@0 | 29 | fail("didn't receive Subsub"); |
michael@0 | 30 | |
michael@0 | 31 | if (!PTestDescSubsubParent::Call__delete__(a)) |
michael@0 | 32 | fail("deleting Subsub"); |
michael@0 | 33 | |
michael@0 | 34 | Close(); |
michael@0 | 35 | |
michael@0 | 36 | return true; |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | |
michael@0 | 40 | PTestDescSubParent* |
michael@0 | 41 | TestDescParent::AllocPTestDescSubParent(PTestDescSubsubParent* dummy) { |
michael@0 | 42 | if (dummy) |
michael@0 | 43 | fail("actor supposed to be null"); |
michael@0 | 44 | return new TestDescSubParent(); |
michael@0 | 45 | } |
michael@0 | 46 | bool |
michael@0 | 47 | TestDescParent::DeallocPTestDescSubParent(PTestDescSubParent* actor) |
michael@0 | 48 | { |
michael@0 | 49 | delete actor; |
michael@0 | 50 | return true; |
michael@0 | 51 | } |
michael@0 | 52 | |
michael@0 | 53 | PTestDescSubsubParent* |
michael@0 | 54 | TestDescSubParent::AllocPTestDescSubsubParent() |
michael@0 | 55 | { |
michael@0 | 56 | return new TestDescSubsubParent(); |
michael@0 | 57 | } |
michael@0 | 58 | bool |
michael@0 | 59 | TestDescSubParent::DeallocPTestDescSubsubParent(PTestDescSubsubParent* actor) |
michael@0 | 60 | { |
michael@0 | 61 | delete actor; |
michael@0 | 62 | return true; |
michael@0 | 63 | } |
michael@0 | 64 | |
michael@0 | 65 | |
michael@0 | 66 | //----------------------------------------------------------------------------- |
michael@0 | 67 | // child |
michael@0 | 68 | |
michael@0 | 69 | bool |
michael@0 | 70 | TestDescChild::RecvTest(PTestDescSubsubChild* a) |
michael@0 | 71 | { |
michael@0 | 72 | if (!a) |
michael@0 | 73 | fail("didn't receive Subsub"); |
michael@0 | 74 | if (!SendOk(a)) |
michael@0 | 75 | fail("couldn't send Ok()"); |
michael@0 | 76 | return true; |
michael@0 | 77 | } |
michael@0 | 78 | |
michael@0 | 79 | PTestDescSubChild* |
michael@0 | 80 | TestDescChild::AllocPTestDescSubChild(PTestDescSubsubChild* dummy) { |
michael@0 | 81 | if (dummy) |
michael@0 | 82 | fail("actor supposed to be null"); |
michael@0 | 83 | return new TestDescSubChild(); |
michael@0 | 84 | } |
michael@0 | 85 | bool |
michael@0 | 86 | TestDescChild::DeallocPTestDescSubChild(PTestDescSubChild* actor) |
michael@0 | 87 | { |
michael@0 | 88 | delete actor; |
michael@0 | 89 | return true; |
michael@0 | 90 | } |
michael@0 | 91 | |
michael@0 | 92 | PTestDescSubsubChild* |
michael@0 | 93 | TestDescSubChild::AllocPTestDescSubsubChild() |
michael@0 | 94 | { |
michael@0 | 95 | return new TestDescSubsubChild(); |
michael@0 | 96 | } |
michael@0 | 97 | bool |
michael@0 | 98 | TestDescSubChild::DeallocPTestDescSubsubChild(PTestDescSubsubChild* actor) |
michael@0 | 99 | { |
michael@0 | 100 | delete actor; |
michael@0 | 101 | return true; |
michael@0 | 102 | } |
michael@0 | 103 | |
michael@0 | 104 | } // namespace _ipdltest |
michael@0 | 105 | } // namespace mozilla |