From 5892598cba33cf0a81fc6bc39561084376e24cd5 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 3 Jul 2023 09:50:34 +0200 Subject: [PATCH] Extend PI client tests * tests/pi/current/client_request_interceptor.cpp: --- .../pi/current/client_request_interceptor.cpp | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/pi/current/client_request_interceptor.cpp b/tests/pi/current/client_request_interceptor.cpp index a63ae264..1566bc74 100644 --- a/tests/pi/current/client_request_interceptor.cpp +++ b/tests/pi/current/client_request_interceptor.cpp @@ -34,20 +34,36 @@ void ClientRequestInterceptor::send_request ( IDL::traits::ref_type ri) { - TAOX11_TEST_INFO << "ClientRequestInterceptor::send_request (" << ri->operation () << ")" << std::endl; + TAOX11_TEST_INFO << "ClientRequestInterceptor::send_request (" << ri->operation () << ") with id " << ri->request_id () << std::endl; - std::string op = ri->operation (); + std::string const op = ri->operation (); if (op != "invoke_me") return; // Don't mess with PICurrent if not invoking test method. + if (op == "shutdown") + { + if (ri->response_expected ()) + { + TAOX11_TEST_ERROR << "ERROR: Shutdown shouldn't have a response expected." << std::endl; + throw CORBA::INTERNAL (); + } + } + else + { + if (!ri->response_expected ()) + { + TAOX11_TEST_ERROR << "ERROR: Other operations shouldn't have a response expected." << std::endl; + throw CORBA::INTERNAL (); + } + } + try { // Retrieve data from the RSC (request scope current). uint32_t number = 0; - CORBA::Any data = - ri->get_slot (this->slot_id_); + CORBA::Any const data = ri->get_slot (this->slot_id_); if (!(data >>= number)) { @@ -65,8 +81,7 @@ ClientRequestInterceptor::send_request ( // Now reset the contents of our slot in the thread-scope // current (TSC). - this->pi_current_->set_slot (this->slot_id_, - new_data); + this->pi_current_->set_slot (this->slot_id_, new_data); // Now retrieve the data from the RSC again. It should not have // changed!