summaryrefslogtreecommitdiff
path: root/ACE/tests/Notification_Queue_Unit_Test.cpp
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-03-08 03:03:23 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-03-08 03:03:23 +0000
commitf1fc1301dc44d1ebd468d065dcab909d544ce036 (patch)
treefd55bb259ae425baf14ebcb75bafae3f407a38d9 /ACE/tests/Notification_Queue_Unit_Test.cpp
parent4b9556bd9d39095df7be2f0497d6dd0c85e994d1 (diff)
downloadATCD-f1fc1301dc44d1ebd468d065dcab909d544ce036.tar.gz
Thu Mar 8 02:59:02 UTC 2007 Carlos O'Ryan <coryan@atdesk.com>
Diffstat (limited to 'ACE/tests/Notification_Queue_Unit_Test.cpp')
-rw-r--r--ACE/tests/Notification_Queue_Unit_Test.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ACE/tests/Notification_Queue_Unit_Test.cpp b/ACE/tests/Notification_Queue_Unit_Test.cpp
index 849d4b14847..76ee3461e12 100644
--- a/ACE/tests/Notification_Queue_Unit_Test.cpp
+++ b/ACE/tests/Notification_Queue_Unit_Test.cpp
@@ -22,6 +22,8 @@ ACE_RCSID(tests,
ACTION(purge_with_no_matches) \
ACTION(purge_with_single_match) \
ACTION(purge_with_multiple_matches) \
+ ACTION(reset_empty_queue) \
+ ACTION(reset_non_empty_queue) \
// Declare all the tests
#define ACTION(TEST_NAME) void TEST_NAME (char const * test_name);
@@ -249,6 +251,36 @@ void purge_with_multiple_matches(char const * test_name)
TEST_EQUAL(result, 1, "purge of eh1/WRITE should return 1");
}
+void reset_empty_queue(char const * /* test_name */)
+{
+ ACE_Notification_Queue queue;
+
+ queue.reset();
+}
+
+void reset_non_empty_queue(char const * /* test_name */)
+{
+ ACE_Notification_Queue queue;
+
+ Event_Handler eh1(1);
+ Event_Handler eh2(2);
+
+ queue.push_new_notification(
+ ACE_Notification_Buffer(0,
+ ACE_Event_Handler::READ_MASK));
+ queue.push_new_notification(
+ ACE_Notification_Buffer(&eh1,
+ ACE_Event_Handler::READ_MASK));
+ queue.push_new_notification(
+ ACE_Notification_Buffer(&eh2,
+ ACE_Event_Handler::WRITE_MASK));
+ queue.push_new_notification(
+ ACE_Notification_Buffer(0,
+ ACE_Event_Handler::WRITE_MASK));
+
+ queue.reset();
+}
+
void test_equal(int x, int y, char const * x_msg, char const * y_msg,
char const * error_message,
char const * test_name, char const * filename, int lineno)