homescreenapp/inc/hstest_global.h
changeset 35 f9ce957a272c
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  The dll header file.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HSTEST_GLOBAL_H
       
    20 #define HSTEST_GLOBAL_H
       
    21 
       
    22 #include <QDebug>
       
    23 #ifdef NFT
       
    24 #ifdef Q_OS_SYMBIAN
       
    25 #include <e32hal.h>
       
    26 #endif
       
    27 #endif
       
    28 
       
    29 #ifndef HOMESCREEN_TEST
       
    30     #define HOMESCREEN_TEST_CLASS(aClassName)
       
    31 #else
       
    32     #define HOMESCREEN_TEST_CLASS(aClassName) class aClassName;
       
    33 #endif //HOMESCREEN_TEST
       
    34 
       
    35 #ifndef HOMESCREEN_TEST
       
    36     #define HOMESCREEN_TEST_FRIEND_CLASS(aClassName)
       
    37 #else
       
    38     #define HOMESCREEN_TEST_FRIEND_CLASS(aClassName) friend class aClassName;
       
    39 #endif //HOMESCREEN_TEST
       
    40 
       
    41 #define HSCATCHDEBUG qDebug("Catched in: %s on line: %d",__FILE__,__LINE__);
       
    42 #define HSDEBUG(a) qDebug() << a << " in: " << __FILE__ << " on line: " << __LINE__;
       
    43 
       
    44 
       
    45 #ifdef NFT
       
    46     #define HSTEST(aText)                  qDebug() << QString(aText)
       
    47 #ifdef Q_OS_SYMBIAN
       
    48     inline void HSTestFreeRam(const QString &aFunction)
       
    49     {
       
    50     TMemoryInfoV1Buf meminfo;
       
    51     UserHal::MemoryInfo(meminfo);
       
    52     int memSize = meminfo().iTotalRamInBytes >> 10;
       
    53     int memFree = meminfo().iFreeRamInBytes >> 10;
       
    54 
       
    55     RHeap& ownHeap = User::Heap();
       
    56     TInt biggestBlock = 0;
       
    57     int heapFree = ownHeap.Available(biggestBlock) >> 10;
       
    58     int heapSize = ownHeap.Size() >> 10;
       
    59     qDebug()<< aFunction << "memFree" << memFree << "kb memSize" << memSize << "kb heapFree" << heapFree << "kb heapSize" << heapSize;
       
    60     }
       
    61 
       
    62     #define HSTEST_FUNC_ENTRY(aFunction)   HSTestFreeRam(QString(aFunction)+" entry")
       
    63     #define HSTEST_FUNC_EXIT(aFunction)    HSTestFreeRam(QString(aFunction)+" exit")
       
    64 #else //Q_OS_SYMBIAN
       
    65     #define HSTEST_FUNC_ENTRY(aFunction)   qDebug()<< aFunction << " entry";
       
    66     #define HSTEST_FUNC_EXIT(aFunction)    qDebug()<< aFunction << " exit";
       
    67 #endif //Q_OS_SYMBIAN
       
    68 #else //NFT
       
    69     #define HSTEST(aText)                   qDebug() << QString(aText)
       
    70     #define HSTEST_FUNC_ENTRY(aFunction)
       
    71     #define HSTEST_FUNC_EXIT(aFunction)
       
    72 #endif //NFT
       
    73 
       
    74 #endif // HSTEST_GLOBAL_H
       
    75