void TestDataStructuresChild::Test3() { int i1i = 42; double i2d = 4.0; IntDouble i1(i1i); IntDouble i2(i2d); IntDouble o1, o2; SendTest3(i1, i2, &o1, &o2); test_assert(i1i == o1.get_int(), "wrong value"); test_assert(i2d == o2.get_double(), "wrong value"); printf(" passed %s\n", __FUNCTION__); }
bool TestUrgencyChild::RecvStart() { uint32_t result; // Send a synchronous message, expect to get an urgent message while // blocked. test_ = kFirstTestBegin; if (!SendTest1(&result)) fail("calling SendTest1"); if (result != 99) fail("bad result in RecvStart"); if (test_ != kFirstTestGotReply) fail("never received urgent message"); // Initiate the next test by sending an asynchronous message, then becoming // blocked. This tests that the urgent message is still delivered properly, // and that the parent does not try to service the sync test_ = kSecondTestBegin; if (!SendTest2()) fail("calling SendTest2"); if (!SendTest3(&result)) fail("calling SendTest3"); if (test_ != kSecondTestGotReply) fail("never received urgent message #2"); if (result != 1000) fail("wrong value from test3"); if (!SendTest4_Begin()) fail("calling SendTest4_Begin"); // This must be the last test, since the child process may die. if (SendFinalTest_Begin()) fail("Final test should not have succeeded"); Close(); return true; }