summaryrefslogtreecommitdiff
path: root/ACE/tests/Bug_2497_Regression_Test.cpp
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
commit99aa8c60282c7b8072eb35eb9ac815702f5bf586 (patch)
treebda96bf8c3a4c2875a083d7b16720533c8ffeaf4 /ACE/tests/Bug_2497_Regression_Test.cpp
parentc4078c377d74290ebe4e66da0b4975da91732376 (diff)
downloadATCD-99aa8c60282c7b8072eb35eb9ac815702f5bf586.tar.gz
undoing accidental deletion
Diffstat (limited to 'ACE/tests/Bug_2497_Regression_Test.cpp')
-rw-r--r--ACE/tests/Bug_2497_Regression_Test.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/ACE/tests/Bug_2497_Regression_Test.cpp b/ACE/tests/Bug_2497_Regression_Test.cpp
new file mode 100644
index 00000000000..d32c96d1660
--- /dev/null
+++ b/ACE/tests/Bug_2497_Regression_Test.cpp
@@ -0,0 +1,75 @@
+/**
+ * @file Bug_2497_Regression_Test.cpp
+ *
+ * $Id$
+ *
+ * Reproduces the problems reported in bug 2497
+ * http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=2497
+ *
+ * @author sergant128@mail.ru
+ */
+
+#include "test_config.h"
+#include "ace/Module.h"
+#include "ace/Task.h"
+#include "ace/Stream.h"
+
+ACE_RCSID (tests,
+ Bug_2497_Regression_Test,
+ "$Id$")
+
+class Test_Task : public ACE_Task<ACE_SYNCH>
+{
+public:
+ Test_Task( void ) :
+ _destructorCalled(0)
+ {
+ }
+
+ virtual ~Test_Task( void )
+ {
+ ++_destructorCalled;
+ if (_destructorCalled > 1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Test_Task::~Test_Task() should be called once!!!\n")));
+ }
+
+private:
+ int _destructorCalled;
+};
+
+
+class Test_Module : public ACE_Module<ACE_SYNCH>
+{
+public:
+ Test_Module( void )
+ {
+ this->open( ACE_TEXT("Test module"),
+ &_writerTask,
+ &_readerTask,
+ 0,
+ M_DELETE_NONE );
+ }
+
+private:
+ Test_Task _writerTask, _readerTask;
+};
+
+
+int
+run_main (int, ACE_TCHAR *[])
+{
+ ACE_START_TEST (ACE_TEXT ("Bug_2497_Regression_Test"));
+
+ ACE_Stream<ACE_SYNCH> stream;
+
+ if (stream.push(new Test_Module()) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Error: push failed\n")));
+ }
+
+ ACE_END_TEST;
+
+ return 0;
+}