Skip to content

Commit

Permalink
Check results
Browse files Browse the repository at this point in the history
    * tests/pi/current/client_request_interceptor.cpp:
    * tests/pi/current/server_request_interceptor.cpp:
  • Loading branch information
jwillemsen committed Oct 28, 2024
1 parent 9704ed2 commit 0d6b278
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
19 changes: 19 additions & 0 deletions tests/pi/current/client_request_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ ClientRequestInterceptor::send_request (

IDL::traits<PortableInterceptor::ClientRequestInfo>::ref_type narrow_ri = IDL::traits<PortableInterceptor::ClientRequestInfo>::narrow (ri);
IDL::traits<PortableInterceptor::ClientRequestInfo>::ref_type narrow_nullptr = IDL::traits<PortableInterceptor::ClientRequestInfo>::narrow (nullptr);
if (!narrow_ri)
{
TAOX11_TEST_ERROR << "ERROR: CRI narrow failed" << std::endl;
}
if (narrow_nullptr)
{
TAOX11_TEST_ERROR << "ERROR: CRI nullptr narrow failed" << std::endl;
}

IDL::traits<PortableInterceptor::RequestInfo>::ref_type cnarrow_ri = IDL::traits<PortableInterceptor::RequestInfo>::narrow (ri);
IDL::traits<PortableInterceptor::RequestInfo>::ref_type cnarrow_nullptr = IDL::traits<PortableInterceptor::RequestInfo>::narrow (nullptr);
if (!cnarrow_ri)
{
TAOX11_TEST_ERROR << "ERROR: rSRI narrow failed" << std::endl;
}
if (cnarrow_nullptr)
{
TAOX11_TEST_ERROR << "ERROR: rSRI nullptr narrow failed" << std::endl;
}

std::string const op = ri->operation ();

Expand Down
19 changes: 17 additions & 2 deletions tests/pi/current/server_request_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,25 @@ ServerRequestInterceptor::receive_request (
PortableInterceptor::ObjectId const oi = ri->object_id ();
IDL::traits<PortableInterceptor::ServerRequestInfo>::ref_type narrow_ri = IDL::traits<PortableInterceptor::ServerRequestInfo>::narrow (ri);
IDL::traits<PortableInterceptor::ServerRequestInfo>::ref_type narrow_nullptr = IDL::traits<PortableInterceptor::ServerRequestInfo>::narrow (nullptr);
if (!narrow_ri)
{
TAOX11_TEST_ERROR << "ERROR: SRI narrow failed" << std::endl;
}
if (narrow_nullptr)
{
TAOX11_TEST_ERROR << "ERROR: SRI nullptr narrow failed" << std::endl;
}

IDL::traits<PortableInterceptor::RequestInfo>::ref_type cnarrow_ri = IDL::traits<PortableInterceptor::RequestInfo>::narrow (ri);
IDL::traits<PortableInterceptor::RequestInfo>::ref_type cnarrow_nullptr = IDL::traits<PortableInterceptor::RequestInfo>::narrow (nullptr);
if (!cnarrow_ri)
{
TAOX11_TEST_ERROR << "ERROR: rSRI narrow failed" << std::endl;
}
if (cnarrow_nullptr)
{
TAOX11_TEST_ERROR << "ERROR: rSRI nullptr narrow failed" << std::endl;
}

CORBA::Any new_data;
uint32_t number = 19;
Expand All @@ -94,8 +110,7 @@ ServerRequestInterceptor::receive_request (
if ((data2 >>= number2)
&& number == number2)
{
TAOX11_TEST_ERROR << "ERROR: TSC was modified because " \
"RSC was modified." << std::endl;
TAOX11_TEST_ERROR << "ERROR: TSC was modified because RSC was modified." << std::endl;

throw CORBA::INTERNAL ();
}
Expand Down

0 comments on commit 0d6b278

Please sign in to comment.