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