Author: dreiss
Date: Thu Jun  4 00:32:54 2009
New Revision: 781629

URL: http://svn.apache.org/viewvc?rev=781629&view=rev
Log:
THRIFT-466. cpp: Make the concurrency library test more thorough

Modified:
    incubator/thrift/trunk/lib/cpp/src/concurrency/test/ThreadManagerTests.h

Modified: 
incubator/thrift/trunk/lib/cpp/src/concurrency/test/ThreadManagerTests.h
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/concurrency/test/ThreadManagerTests.h?rev=781629&r1=781628&r2=781629&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/concurrency/test/ThreadManagerTests.h 
(original)
+++ incubator/thrift/trunk/lib/cpp/src/concurrency/test/ThreadManagerTests.h 
Thu Jun  4 00:32:54 2009
@@ -282,7 +282,19 @@
       try {
         threadManager->add(extraTask, 1);
         throw TException("Unexpected success adding task in excess of pending 
task count");
+      } catch(TooManyPendingTasksException& e) {
+        throw TException("Should have timed out adding task in excess of 
pending task count");
       } catch(TimedOutException& e) {
+        // Expected result
+      }
+
+      try {
+        threadManager->add(extraTask, -1);
+        throw TException("Unexpected success adding task in excess of pending 
task count");
+      } catch(TimedOutException& e) {
+        throw TException("Unexpected timeout adding task in excess of pending 
task count");
+      } catch(TooManyPendingTasksException& e) {
+        // Expected result
       }
 
       std::cout << "\t\t\t" << "Pending tasks " << 
threadManager->pendingTaskCount()  << std::endl;
@@ -351,6 +363,7 @@
       }
 
     } catch(TException& e) {
+      std::cout << "ERROR: " << e.what() << std::endl;
     }
 
     std::cout << "\t\t\t" << (success ? "Success" : "Failure") << std::endl;


Reply via email to