Skip to content

Commit

Permalink
Merge branch 'master' into jwi-proxysource
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillemsen authored Apr 18, 2024
2 parents 207dbc8 + 35f163c commit ff034f5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/cli/hdr/valuebox_def.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected:
template <typename _Tp1, typename, typename ...Args>
friend constexpr TAOX11_CORBA::valuetype_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args);

static const std::string __<%= cxxname.downcase %>_repository_id;
static inline const std::string __<%= cxxname.downcase %>_repository_id {"<%= repository_id %>"};

<%= cxxname %> () = default;
<%= cxxname %> (const <%= cxxname %>&) = default;
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/cli/hdr/valuetype_pre.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected:
% end
using _shared_ptr_type = std::shared_ptr<<%= cxxname %>>;

static const std::string __<%= cxxname.downcase %>_repository_id;
static inline const std::string __<%= cxxname.downcase %>_repository_id {"<%= repository_id %>"};

% if is_truncatable?
<%= cxxname %> ();
Expand Down
2 changes: 0 additions & 2 deletions ridlbe/c++11/templates/cli/src/valuebox_def.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

// generated from <%= ridl_template_path %>
const std::string <%= scoped_cxxname %>::__<%= cxxname.downcase %>_repository_id {"<%= repository_id %>"};

TAOX11_IDL::traits<TAOX11_CORBA::ValueBase>::ref_type
<%= scoped_cxxname %>::_copy_value () const
{
Expand Down
2 changes: 0 additions & 2 deletions ridlbe/c++11/templates/cli/src/valuetype_pre.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ bool
return true;
}

const std::string <%= cxxname %>::__<%= cxxname.downcase %>_repository_id {"<%= repository_id %>"};

const std::string&
<%= cxxname %>::_obv_repository_id () const
{
Expand Down
8 changes: 4 additions & 4 deletions tests/string/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ main(int argc, char* argv[])
{
TAOX11_TEST_DEBUG << "Test string type." << std::endl;
std::string getText = hello->get_string ();
if (getText != "Hello there!")
if (getText != test_string)
{
TAOX11_TEST_ERROR << "ERROR: hello->get_string() returned an unexpected value. "
<< "expected <Hello there!>, received <" << getText << ">" << std::endl;
<< "expected <" << test_string << ">, received <" << getText << ">" << std::endl;
++result;
}
hello->set_string ("Hello there!");
hello->set_string (test_string);
}

{
Expand All @@ -75,7 +75,7 @@ main(int argc, char* argv[])

{
TAOX11_TEST_DEBUG << "Test string type inout parameter." << std::endl;
std::string inoutText = "Hello there!";
std::string inoutText = test_string;
hello->inout_string (inoutText);
if (inoutText != "I hear you!")
{
Expand Down
10 changes: 5 additions & 5 deletions tests/string/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ Hello::Hello (IDL::traits<CORBA::ORB>::ref_type orb, int& result)
std::string
Hello::get_string ()
{
return "Hello there!";
return test_string;
}

void
Hello::set_string (const std::string& text)
{
if (text != "Hello there!")
if (text != test_string)
{
TAOX11_TEST_ERROR << "ERROR: Hello::set_string received an unexpected value. "
<< "expected <Hello there!>, received <" << text <<">" << std::endl;
<< "expected <" << test_string << ">, received <" << text <<">" << std::endl;
++this->result_;
}
}
Expand All @@ -43,10 +43,10 @@ Hello::out_string (std::string& text)
void
Hello::inout_string (std::string& text)
{
if (text != "Hello there!")
if (text != test_string)
{
TAOX11_TEST_ERROR << "ERROR: Hello::inout_string received an unexpected value. "
<< "expected <Hello there!>, received <" << text << ">" << std::endl;
<< "expected <" << test_string << "!>, received <" << text << ">" << std::endl;
++this->result_;
}
text = "I hear you!";
Expand Down
1 change: 1 addition & 0 deletions tests/string/test.idl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "orb.idl"

const string name = "testing";
const string test_string = "Hello there!";

/// Put the interfaces in a module, to avoid global namespace pollution
module Test
Expand Down

0 comments on commit ff034f5

Please sign in to comment.