Skip to content

Commit

Permalink
Test Exception::_name()
Browse files Browse the repository at this point in the history
    * tao/x11/user_exception.h:
    * tests/exceptions/extended/client.cpp:
  • Loading branch information
jwillemsen committed Oct 25, 2023
1 parent 09ef4e7 commit 001e66b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tao/x11/user_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ namespace TAOX11_NAMESPACE {
/// Constructor using a repository id.
UserException (const char *repository_id,
const char *local_name)
: CORBA::Exception (repository_id,
local_name)
: CORBA::Exception (repository_id, local_name)
{
}

Expand Down
10 changes: 8 additions & 2 deletions tests/exceptions/extended/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ test_bar_object (IDL::traits<Test::Foo>::ref_type foo)
catch (const Test::BarEx &x)
{
uint16_t const prev_result = result;
IDL::traits<Test::Bar>::ref_type bar =
x.bar_i();
IDL::traits<Test::Bar>::ref_type bar = x.bar_i();
if (!bar)
{
TAOX11_TEST_ERROR << "test_bar_object - ERROR : catching a Test::BarEx but "
Expand Down Expand Up @@ -64,6 +63,13 @@ test_bar_object (IDL::traits<Test::Foo>::ref_type foo)
<< "found <" << ex.struct_i ().msg () << ">" << std::endl;
++result;
}
if (std::strcmp(ex._name (), "StructEx") != 0)
{
TAOX11_TEST_ERROR << "test_bar_object - ERROR : Correct exception caught "

Check warning on line 68 in tests/exceptions/extended/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/exceptions/extended/client.cpp#L68

Added line #L68 was not covered by tests
<< "but '_name' seems to contain a wrong value. expected <StructEx> - "
<< "found <" << ex._name () << ">" << std::endl;
++result;

Check warning on line 71 in tests/exceptions/extended/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/exceptions/extended/client.cpp#L70-L71

Added lines #L70 - L71 were not covered by tests
}
}
catch (...)
{
Expand Down

0 comments on commit 001e66b

Please sign in to comment.