diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-29 10:17:39 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-29 10:17:39 +0100 |
commit | daa794e611a517655f168d3bc5db6769a888c8ee (patch) | |
tree | 34fd56d9e7fba445ee220a07dd9de9b385a9e414 /TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp | |
parent | 7894e0072e564bfd01d4ac805b9201548dbd670a (diff) | |
download | ATCD-daa794e611a517655f168d3bc5db6769a888c8ee.tar.gz |
Minor test changes and add new test to the test list as not fixedrepro-fragmentation-issue
* TAO/bin/tao_orb_tests.lst:
* TAO/tests/GIOP_Fragments/Big_String_Sequence/Big_String_Sequence.mpc:
* TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo.idl:
* TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp:
* TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.h:
* TAO/tests/GIOP_Fragments/Big_String_Sequence/client.cpp:
* TAO/tests/GIOP_Fragments/Big_String_Sequence/server.cpp:
Diffstat (limited to 'TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp')
-rw-r--r-- | TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp b/TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp index bd1e6203b21..04f187eb814 100644 --- a/TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp +++ b/TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp @@ -1,6 +1,6 @@ #include "Echo_i.h" -enum { BIG_LENGTH = 4 * 1024 }; +constexpr size_t BIG_LENGTH = 4 * 1024; // Constructor. @@ -9,24 +9,17 @@ Echo_i::Echo_i (CORBA::ORB_ptr o) { } -// Destructor. - -Echo_i::~Echo_i () -{ -} - // Return a list of strings. - Echo::List * Echo_i::return_list () { Echo::List_var list; { - Echo::List *tmp = 0; + Echo::List *tmp {}; ACE_NEW_RETURN (tmp, Echo::List (2), - 0); + {}); list = tmp; } @@ -34,12 +27,11 @@ Echo_i::return_list () // Just do something to get a 'big' list of strings. CORBA::Char big[BIG_LENGTH + 1]; - for (int i = 0; i < BIG_LENGTH; ++i) + for (size_t i = 0; i < BIG_LENGTH; ++i) big[i] = 'A'; big[BIG_LENGTH] = 0; - CORBA::Char small[] = "Hello World"; list[CORBA::ULong(0)] = CORBA::string_dup(big); - list[CORBA::ULong(1)] = CORBA::string_dup(small); + list[CORBA::ULong(1)] = CORBA::string_dup("Hello World"); return list._retn (); } @@ -50,10 +42,10 @@ Echo_i::return_wlist () Echo::WList_var list; { - Echo::WList *tmp = 0; + Echo::WList *tmp {}; ACE_NEW_RETURN (tmp, Echo::WList (2), - 0); + {}); list = tmp; } @@ -61,11 +53,11 @@ Echo_i::return_wlist () // Just do something to get a 'big' list of wide strings. CORBA::WChar big[BIG_LENGTH + 1]; - for (int i = 0; i < BIG_LENGTH; ++i) + for (size_t i = 0; i < BIG_LENGTH; ++i) big[i] = 'A'; big[BIG_LENGTH] = 0; CORBA::WChar small[17 + 1]; - for (int i = 0; i < 17; ++i) + for (size_t i = 0; i < 17; ++i) small[i] = 'B'; small[17] = 0; list[CORBA::ULong(0)] = CORBA::wstring_dup(big); @@ -77,7 +69,7 @@ Echo_i::return_wlist () // Shutdown the server application. void -Echo_i::shutdown (void) +Echo_i::shutdown () { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nThe echo server is shutting down\n"))); |