示例#1
0
 void TestStartTwiceFails()
 {
     SCXCoreLib::SCXHandle<SCXCoreLib::SCXThread> thread = GivenARunningThread();
     SCXUNIT_ASSERT_THROWN_EXCEPTION(thread->Start(SCXThreadTest::SimpleThreadBodyTerminate), SCXCoreLib::SCXThreadStartException, L"started");
     thread->RequestTerminate();
     thread->Wait();
 }
示例#2
0
 void TestThreadExceptionHaveCorrectThreadID()
 {
     SCXCoreLib::SCXHandle<SCXCoreLib::SCXThread> thread = GivenARunningThread();
     try {
         thread->Start(SCXThreadTest::SimpleThreadBodyTerminate);
         CPPUNIT_FAIL("Expected exception not thrown: SCXThreadStartException");
     } catch (SCXCoreLib::SCXThreadStartException& e) {
         CPPUNIT_ASSERT_EQUAL(SCXCoreLib::SCXThread::GetCurrentThreadID(), e.GetThreadID());
     }
 }