stif/TestServer/src/TestExecutionThread.cpp
changeset 26 4fde310f06fe
parent 0 a03f92240627
child 30 86a2e675b80a
equal deleted inserted replaced
21:f5d4820de50d 26:4fde310f06fe
   270         // Print module name
   270         // Print module name
   271         moduleName = aModule.FileName();    
   271         moduleName = aModule.FileName();    
   272         __TRACEI (KInit, (  _L("Loaded test module[%S]"), &moduleName ) );
   272         __TRACEI (KInit, (  _L("Loaded test module[%S]"), &moduleName ) );
   273         }
   273         }
   274 
   274 
   275     // Verify the UID
   275     
   276     TUid KUidTestModule = TUid::Uid ( 0x101FB3E7 );
       
   277     TUidType requiredUID( KDynamicLibraryUid, KSharedLibraryUid, KUidTestModule );
       
   278 
       
   279     TUidType moduleUID = aModule.Type();    
       
   280     if ( moduleUID != requiredUID )
       
   281         {
       
   282         // New instance can't be created
       
   283         RDebug::Print( ( _L("STIF TF: Test module has invalid UID. Aborting loading!") ) );
       
   284         __TRACEI (KError, ( CStifLogger::EError, _L("Test module has invalid UID. Aborting loading!")));
       
   285         tmpBuffer.Format(_L("Module [%S] has invalid UID"), &moduleName);
       
   286         ErrorPrint( 1, tmpBuffer ); 
       
   287         ModuleContainer().OperationErrorResult() = KErrNotSupported;
       
   288         return KErrNotSupported;
       
   289         }
       
   290 
       
   291     // Get pointer to first exported function
   276     // Get pointer to first exported function
   292     ModuleContainer().OperationText() = _L("1st EXPORTED function");
   277     ModuleContainer().OperationText() = _L("1st EXPORTED function");
   293     CTestInterfaceFactory libEntry;
   278     CTestInterfaceFactory libEntry;
   294     libEntry = (CTestInterfaceFactory) aModule.Lookup(1);
   279     libEntry = (CTestInterfaceFactory) aModule.Lookup(1);
   295     if ( libEntry == NULL )
   280     if ( libEntry == NULL )
  2154 
  2139 
  2155     Status: Proposal
  2140     Status: Proposal
  2156 
  2141 
  2157 -------------------------------------------------------------------------------
  2142 -------------------------------------------------------------------------------
  2158 */
  2143 */
  2159 void CTestThreadContainer::IsServerAlive()
  2144 void CTestThreadContainer::IsServerAlive() const
  2160     {
  2145     {
  2161         
  2146         
  2162     if( iServerThread.ExitType() != EExitPending ) 
  2147     if( iServerThread.ExitType() != EExitPending ) 
  2163         {
  2148         {
  2164         // Server thread has died
  2149         // Server thread has died
  2185 
  2170 
  2186     Status: Proposal
  2171     Status: Proposal
  2187 
  2172 
  2188 -------------------------------------------------------------------------------
  2173 -------------------------------------------------------------------------------
  2189 */
  2174 */
  2190 CTestExecution& CTestThreadContainer::TestExecution()
  2175 CTestExecution& CTestThreadContainer::TestExecution() const
  2191     { 
  2176     { 
  2192     
  2177     
  2193     IsServerAlive();
  2178     IsServerAlive();
  2194     CTestExecution* execution = iModuleContainer->TestExecution();
  2179     CTestExecution* execution = iModuleContainer->TestExecution();
  2195     if( execution == NULL )
  2180     if( execution == NULL )
  2197         Panic( ENullExecution );
  2182         Panic( ENullExecution );
  2198         }
  2183         }
  2199     return *execution;
  2184     return *execution;
  2200     
  2185     
  2201     };
  2186     };
  2202     
  2187 
       
  2188 /*
       
  2189 -------------------------------------------------------------------------------
       
  2190 
       
  2191     Class: CTestThreadContainer
       
  2192 
       
  2193     Method: GetTestCaseArguments
       
  2194 
       
  2195     Description: Get test case arguments
       
  2196 
       
  2197     Parameters: None
       
  2198     
       
  2199     Return Values: test case arguments
       
  2200 
       
  2201     Errors/Exceptions: 
       
  2202 
       
  2203     Status: Proposal
       
  2204 
       
  2205 -------------------------------------------------------------------------------
       
  2206 */
       
  2207 const TDesC& CTestThreadContainer::GetTestCaseArguments() const
       
  2208     {
       
  2209     return TestExecution().GetTestCaseArguments();
       
  2210     }
       
  2211 
       
  2212 
  2203 /*
  2213 /*
  2204 -------------------------------------------------------------------------------
  2214 -------------------------------------------------------------------------------
  2205 
  2215 
  2206     Class: CTestThreadContainer
  2216     Class: CTestThreadContainer
  2207 
  2217