Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_3548_Regression / client.cpp
blob94b05e0b7662560eace56ce1a1b2a3a9ddf17e2a
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 //---------------------------------------------------------------------------