%description: Test the const version of the check_and_cast() function. %activity: // create a cPacket as cMessage const cOwnedObject *msg = new cMessage(); // this should succeed const cMessage *p1 = check_and_cast(msg); EV << "p1:" << (p1!=nullptr) << endl; // and this one not const cQueue *p2 = check_and_cast(msg); (void)p2; EV << "fell through" << endl; %exitcode: 1 %contains: stdout p1:1 %contains: stderr Cannot cast %not-contains: stdout fell through