Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / Bug_3548_Regression / client.cpp
blobc72b9a0927e21ebed810cec0646db5d13b4e621c
1 //---------------------------------------------------------------------------
2 #include "memeaterC.h"
3 #include "ace/OS_NS_unistd.h"
5 //---------------------------------------------------------------------------
7 MEMEATER::StringSeq* _message_buffer = 0;
8 #define MAX_MSG_BUF 100
10 void eat_my_memory()
12 const char * output_string = "Eat my Memory! Eat my Memory! Eat my Memory! Eat my Memory!";
14 CORBA::ULong msg_count = _message_buffer->length();
15 if (msg_count < MAX_MSG_BUF)
17 _message_buffer->length(msg_count+1);
18 (*_message_buffer)[msg_count] = CORBA::string_dup( output_string);
20 else
22 _message_buffer->length(1);
23 (*_message_buffer)[0] = CORBA::string_dup( output_string);
27 int ACE_TMAIN(int, ACE_TCHAR*[])
29 _message_buffer = new MEMEATER::StringSeq;
30 _message_buffer->length(0);
32 try
34 for (int i = 0; i < 1000; i++)
36 eat_my_memory();
39 catch (const ::CORBA::Exception &ex)
41 ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :");
42 return 1;
45 delete _message_buffer;
47 return 0;
49 //---------------------------------------------------------------------------