Skip to content

Commit 259367e

Browse files
committed
Removed use of std namespace (really?)
1 parent 477f0da commit 259367e

2 files changed

Lines changed: 32 additions & 12 deletions

File tree

TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#include <string>
21
#include "Echo_i.h"
32

3+
enum { BIG_LENGTH = 4 * 1024 };
4+
45
// Constructor.
56

67
Echo_i::Echo_i (CORBA::ORB_ptr o)
@@ -32,10 +33,13 @@ Echo_i::return_list ()
3233
list->length (2);
3334

3435
// Just do something to get a 'big' list of strings.
35-
std::string big(4 * 1024, 'A');
36-
std::string small("Hello World");
37-
list[CORBA::ULong(0)] = CORBA::string_dup(big.c_str());
38-
list[CORBA::ULong(1)] = CORBA::string_dup(small.c_str());
36+
CORBA::Char big[BIG_LENGTH + 1];
37+
for (int i = 0; i < BIG_LENGTH; ++i)
38+
big[i] = 'A';
39+
big[BIG_LENGTH] = 0;
40+
CORBA::Char small[] = "Hello World";
41+
list[CORBA::ULong(0)] = CORBA::string_dup(big);
42+
list[CORBA::ULong(1)] = CORBA::string_dup(small);
3943

4044
return list._retn ();
4145
}
@@ -56,10 +60,16 @@ Echo_i::return_wlist ()
5660
list->length (2);
5761

5862
// Just do something to get a 'big' list of wide strings.
59-
std::wstring big(4 * 1024, 'A');
60-
std::wstring small(17, 'B');
61-
list[CORBA::ULong(0)] = CORBA::wstring_dup(big.c_str());
62-
list[CORBA::ULong(1)] = CORBA::wstring_dup(small.c_str());
63+
CORBA::WChar big[BIG_LENGTH + 1];
64+
for (int i = 0; i < BIG_LENGTH; ++i)
65+
big[i] = 'A';
66+
big[BIG_LENGTH] = 0;
67+
CORBA::WChar small[17 + 1];
68+
for (int i = 0; i < 17; ++i)
69+
small[i] = 'B';
70+
small[17] = 0;
71+
list[CORBA::ULong(0)] = CORBA::wstring_dup(big);
72+
list[CORBA::ULong(1)] = CORBA::wstring_dup(small);
6373

6474
return list._retn ();
6575
}

TAO/tests/GIOP_Fragments/Big_String_Sequence/client.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
6161
ACE_ERROR_RETURN ((LM_ERROR, "Expected length 2\n"), -1);
6262
}
6363
const char* value = (*list)[0].in();
64-
size_t length = std::strlen(value);
64+
size_t length = strlen(value);
6565
ACE_DEBUG ((LM_DEBUG,
6666
"First element has length %u\n",
6767
length));
@@ -75,15 +75,25 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
7575
}
7676
}
7777
value = (*list)[1].in();
78-
length = std::strlen(value);
78+
length = strlen(value);
7979
ACE_DEBUG ((LM_DEBUG,
8080
"Second element has length %u, value: %s\n",
8181
length, value));
82-
if (std::strcmp(value, "Hello World") != 0)
82+
if (strcmp(value, "Hello World") != 0)
8383
{
8484
ACE_ERROR_RETURN ((LM_ERROR, "Expected \"Hello World\""), -1);
8585
}
8686

87+
Echo::WList_var wlist = echo->return_wlist();
88+
89+
ACE_DEBUG ((LM_DEBUG,
90+
"Received wide list of length %u\n",
91+
wlist->length()));
92+
if (wlist->length() != 2)
93+
{
94+
ACE_ERROR_RETURN ((LM_ERROR, "Expected length 2\n"), -1);
95+
}
96+
8797
echo->shutdown ();
8898
orb->destroy ();
8999
}

0 commit comments

Comments
 (0)