Added thread factory test - problems in thread
Fixed stupid typo in TimerManager::start
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664723 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/test/Tests.cc b/lib/cpp/src/concurrency/test/Tests.cc
new file mode 100644
index 0000000..36f29ff
--- /dev/null
+++ b/lib/cpp/src/concurrency/test/Tests.cc
@@ -0,0 +1,52 @@
+#include <iostream>
+#include <string>
+
+#include "ThreadFactoryTests.h"
+#include "TimerManagerTests.h"
+
+int main(int argc, char** argv) {
+
+ std::string arg;
+
+ if(argc < 2) {
+
+ arg = "all";
+
+ } else {
+
+ arg = std::string(argv[1]);
+ }
+
+ bool runAll = arg.compare("all") == 0;
+
+ if(runAll || arg.compare("thread-factory") == 0) {
+
+ ThreadFactoryTests threadFactoryTests;
+
+ std::cout << "ThreadFactory tests..." << std::endl;
+
+ std::cout << "\tThreadFactory hello-world test" << std::endl;
+
+ assert(threadFactoryTests.helloWorldTest());
+
+ std::cout << "\t\tThreadFactory reap N threads test: N = 100" << std::endl;
+
+ assert(threadFactoryTests.reapNThreads(100));
+
+ std::cout << "\t\tThreadFactory synchrous start test" << std::endl;
+
+ assert(threadFactoryTests.synchStartTest());
+ }
+
+ if(runAll || arg.compare("timer-manager") == 0) {
+
+ std::cout << "TimerManager tests..." << std::endl;
+
+ std::cout << "\t\tTimerManager test00" << std::endl;
+
+ TimerManagerTests timerManagerTests;
+
+ assert(timerManagerTests.test00());
+ }
+}
+