Skip to content

Commit

Permalink
Merge pull request RemedyIT#382 from jwillemsen/jwi-currentests
Browse files Browse the repository at this point in the history
Extend PI tests
  • Loading branch information
jwillemsen authored May 3, 2024
2 parents 8177f77 + 8f66cf3 commit 69a582d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
17 changes: 10 additions & 7 deletions tests/pi/current/server_orb_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,20 @@ ServerORBInitializer::post_init (
::slot_id = info->allocate_slot_id ();

IDL::traits<PortableInterceptor::ServerRequestInterceptor>::ref_type server_interceptor =
CORBA::make_reference<ServerRequestInterceptor> (
::slot_id,
pi_current);
CORBA::make_reference<ServerRequestInterceptor> (::slot_id, pi_current);

info->add_server_request_interceptor (server_interceptor);
IDL::traits<PortableInterceptor::ServerRequestInterceptor>::ref_type server_interceptor2 =
IDL::traits<PortableInterceptor::ServerRequestInterceptor>::narrow (server_interceptor);

info->add_server_request_interceptor (server_interceptor2);

IDL::traits<PortableInterceptor::ClientRequestInterceptor>::ref_type client_interceptor =
CORBA::make_reference<ClientRequestInterceptor2> (
::slot_id);
CORBA::make_reference<ClientRequestInterceptor2> (::slot_id);

IDL::traits<PortableInterceptor::ClientRequestInterceptor>::ref_type client_interceptor2 =
IDL::traits<PortableInterceptor::ClientRequestInterceptor>::narrow (client_interceptor);

info->add_client_request_interceptor (client_interceptor);
info->add_client_request_interceptor (client_interceptor2);

// // Disable collocation -- TAO-specific!!!
// //
Expand Down
6 changes: 5 additions & 1 deletion tests/pi/current/server_request_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ServerRequestInterceptor::receive_request_service_contexts (
{
TAOX11_TEST_INFO << "ServerRequestInterceptor::receive_request_service_contexts (" << ri->operation () << ")" << 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.
Expand Down Expand Up @@ -70,6 +70,10 @@ ServerRequestInterceptor::receive_request (

try
{
CORBA::OctetSeq const ai = ri->adapter_id ();
PortableInterceptor::ObjectId const oi = ri->object_id ();
IDL::traits<PortableInterceptor::ServerRequestInfo>::ref_type narrow_ri = IDL::traits<PortableInterceptor::ServerRequestInfo>::narrow (ri);

CORBA::Any new_data;
uint32_t number = 19;
new_data <<= number;
Expand Down

0 comments on commit 69a582d

Please sign in to comment.