summaryrefslogtreecommitdiff
path: root/ACE/tests/Auto_Event_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2007-03-22 18:26:23 +0000
committerSteve Huston <shuston@riverace.com>2007-03-22 18:26:23 +0000
commit0cfc57efce5ab8e59fc9a88028dbd12fa3b72085 (patch)
tree7d0bcf5c893837333f36b2ee14be27f9a9f2abcb /ACE/tests/Auto_Event_Test.cpp
parent4ad6a0f5590825e705aa811a27a906d48656a0ff (diff)
downloadATCD-0cfc57efce5ab8e59fc9a88028dbd12fa3b72085.tar.gz
ChangeLogTag:Thu Mar 22 18:25:01 UTC 2007 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/tests/Auto_Event_Test.cpp')
-rw-r--r--ACE/tests/Auto_Event_Test.cpp47
1 files changed, 32 insertions, 15 deletions
diff --git a/ACE/tests/Auto_Event_Test.cpp b/ACE/tests/Auto_Event_Test.cpp
index b7fd8c59049..e2ed56f46a8 100644
--- a/ACE/tests/Auto_Event_Test.cpp
+++ b/ACE/tests/Auto_Event_Test.cpp
@@ -79,8 +79,15 @@ test_timeout (void)
wait.sec (wait.sec () + wait_secs);
if (evt.wait (&wait) == -1)
- ACE_ASSERT (errno == ETIME);
-
+ {
+ if (errno != ETIME)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("test_timeout should be ETIME but is")));
+ status = -1;
+ }
+ }
ACE_Time_Value wait_diff = ACE_OS::gettimeofday () - begin;
msecs_waited = wait_diff.msec ();
@@ -89,12 +96,13 @@ test_timeout (void)
if (msecs_diff > ACE_ALLOWED_SLACK)
{
- ACE_DEBUG ((LM_DEBUG,
+ ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Timed wait fails length test\n")));
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Value: %d ms, actual %d ms\n"),
- msecs_expected,
- msecs_waited));
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Expected %d ms, actual %d ms; %d allowed\n"),
+ (int)msecs_expected,
+ (int)msecs_waited,
+ (int)ACE_ALLOWED_SLACK));
status = -1;
}
@@ -149,19 +157,27 @@ worker (void *)
if (evt.wait (&tv) == -1)
{
// verify that we have ETIME
- ACE_ASSERT(ACE_OS::last_error() == ETIME);
- ++timeouts;
+ if (ACE_OS::last_error() != ETIME)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("Worker should be ETIME but is")));
+ }
+ else
+ ++timeouts;
ACE_Time_Value diff = ACE_OS::gettimeofday ();
diff = diff - tv; // tv should have been reset to time acquired
long diff_msec = diff.msec ();
if (diff_msec > ACE_ALLOWED_SLACK)
{
- ACE_DEBUG ((LM_DEBUG,
+ ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Acquire fails time reset test\n")));
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Diff btw now and returned time: %d ms\n"),
- diff.msec ()));
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Diff btw now and returned time: %d ms; ")
+ ACE_TEXT ("%d allowed\n"),
+ (int)diff_msec,
+ (int)ACE_ALLOWED_SLACK));
test_result = 1;
}
// Hold the lock for a while.
@@ -212,9 +228,10 @@ int run_main (int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Worker threads timed out %d percent of the time\n"),
- percent));
+ (int)percent));
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Auto_Event Test successful\n")));
+ if (test_result == 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Auto_Event Test successful\n")));
#else
ACE_UNUSED_ARG (argc);
ACE_UNUSED_ARG (argv);