Skip to content

Commit

Permalink
Extended ostream insertion logging
Browse files Browse the repository at this point in the history
    * ridlbe/c++11/templates/cli/hdr/bitset_idl_traits.erb:
    * tests/idl4/bitset/client.cpp:
  • Loading branch information
jwillemsen committed Nov 22, 2024
1 parent 3ab46c7 commit cb60e55
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ridlbe/c++11/templates/cli/hdr/bitset_idl_traits.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

%# TODO handle inheritance
// generated from <%= ridl_template_path %>
template<>
struct traits <<%= scoped_cxxtype %>>
Expand All @@ -22,6 +21,9 @@ struct formatter<<%= scoped_cxxtype %>, OStrm_>
{
%_sep = nil
os_ << "<%= formatted_cxxname %>{"
%unless base.nil?
<< IDL::traits<<%= base.cxxname %>>::write(val_) << ','
%end
%bitfields.each do |_m|
% unless _m.cxxname.empty?
<< "<%= _sep %><%= _m.cxxname %>=" << IDL::traits<<%= _m.scoped_cxxtype %>>::write(val_.<%= _m.cxxname %> ())
Expand Down
54 changes: 54 additions & 0 deletions tests/idl4/bitset/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,60 @@ int main (int argc, char* argv[])
}
TAOX11_TEST_DEBUG << "Received MyBitset1 sret1: " << sret1 << " sinout1: " << sinout1 << " sout1: " << sout1 << std::endl;

MyBitset2 sin2 {};
MyBitset2 sinout2 {};
MyBitset2 sout2 {};

TAOX11_TEST_DEBUG << "Sending MyBitset2 sin: " << sin2 << " sinout: " << sinout2 << std::endl;
MyBitset2 const sret2 = foo->test_mybitset2 (sin2, sinout2, sout2);
if (sout2 != sin2)
{
TAOX11_TEST_ERROR << "ERROR: sout2<" << sout2 << "> != sin2<" << sin2 << ">" << std::endl;
++error_count;

Check warning on line 78 in tests/idl4/bitset/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/idl4/bitset/client.cpp#L77-L78

Added lines #L77 - L78 were not covered by tests
}
if (sinout2 != sin2)
{
TAOX11_TEST_ERROR << "ERROR: sinout2<" << sinout2 << "> != sin<" << sin2 << ">" << std::endl;
++error_count;

Check warning on line 83 in tests/idl4/bitset/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/idl4/bitset/client.cpp#L82-L83

Added lines #L82 - L83 were not covered by tests
}
TAOX11_TEST_DEBUG << "Received MyBitset2 sret2: " << sret2 << " sinout2: " << sinout2 << " sout2: " << sout2 << std::endl;

MyBitset3 sin3 {};
MyBitset3 sinout3 {};
MyBitset3 sout3 {};

TAOX11_TEST_DEBUG << "Sending MyBitset3 sin: " << sin3 << " sinout: " << sinout3 << std::endl;
MyBitset3 const sret3 = foo->test_mybitset3 (sin3, sinout3, sout3);
if (sout3 != sin3)
{
TAOX11_TEST_ERROR << "ERROR: sout3<" << sout3 << "> != sin3<" << sin3 << ">" << std::endl;
++error_count;

Check warning on line 96 in tests/idl4/bitset/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/idl4/bitset/client.cpp#L95-L96

Added lines #L95 - L96 were not covered by tests
}
if (sinout3 != sin3)
{
TAOX11_TEST_ERROR << "ERROR: sinout3<" << sinout3 << "> != sin<" << sin3 << ">" << std::endl;
++error_count;

Check warning on line 101 in tests/idl4/bitset/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/idl4/bitset/client.cpp#L100-L101

Added lines #L100 - L101 were not covered by tests
}
TAOX11_TEST_DEBUG << "Received MyBitset3 sret3: " << sret3 << " sinout3: " << sinout3 << " sout3: " << sout3 << std::endl;

MyBitset4 sin4 {};
MyBitset4 sinout4 {};
MyBitset4 sout4 {};

TAOX11_TEST_DEBUG << "Sending MyBitset4 sin: " << sin4 << " sinout: " << sinout4 << std::endl;
MyBitset4 const sret4 = foo->test_mybitset4 (sin4, sinout4, sout4);
if (sout4 != sin4)
{
TAOX11_TEST_ERROR << "ERROR: sout4<" << sout4 << "> != sin4<" << sin4 << ">" << std::endl;
++error_count;

Check warning on line 114 in tests/idl4/bitset/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/idl4/bitset/client.cpp#L113-L114

Added lines #L113 - L114 were not covered by tests
}
if (sinout4 != sin4)
{
TAOX11_TEST_ERROR << "ERROR: sinout4<" << sinout4 << "> != sin<" << sin4 << ">" << std::endl;
++error_count;

Check warning on line 119 in tests/idl4/bitset/client.cpp

View check run for this annotation

Codecov / codecov/patch

tests/idl4/bitset/client.cpp#L118-L119

Added lines #L118 - L119 were not covered by tests
}
TAOX11_TEST_DEBUG << "Received MyBitset4 sret4: " << sret4 << " sinout4: " << sinout4 << " sout4: " << sout4 << std::endl;

TAOX11_TEST_DEBUG << "shutting down..." << std::endl;
foo->shutdown ();
_orb->destroy ();
Expand Down

0 comments on commit cb60e55

Please sign in to comment.