searcher/tsrc/cpixsearchertest/inc/multithreadtester.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 19 Apr 2010 14:40:16 +0300
changeset 0 671dee74050a
permissions -rw-r--r--
Revision: 201011 Kit: 201015

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/

#ifndef MULTITHREADTESTER_H_
#define MULTITHREADTESTER_H_

#include <e32base.h>

class CWorker; 

/**
 * This test mainly tests, whether the server crashes or not under concurrent
 * use from a moderate amount of threads. The test has 4 worker threads 
 * performing concurrent indexing and 5 searcher threads performing concurrent
 * searching. The test fails, if any operations fail (still, whether items
 * indexed are really in index, or if the search results are valid are not 
 * tested)
 */
class CTestMultiThreading : public CBase
{   
public:
    CTestMultiThreading(){}
private:
    void setUp();
    void tearDown();
public:
    void PrepareL();
    void Wait(TInt aSeconds);
    void RunL(); 
    void Finish();    
    void DoTestMultiThreadingL();

private:
    // CPix database 
    
    RPointerArray<CWorker> *iWorkers; 
};

#endif /* MULTITHREADTESTER_H_ */