telephonyutils/telephonywatchers/src/WatcherTestHooks.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "WatcherTestHooks.h"
       
    17 
       
    18 #ifdef WATCHER_TESTING
       
    19 #include <e32math.h>
       
    20 
       
    21 //
       
    22 // ------> WHelpers (source)
       
    23 //
       
    24 TInt WHelpers::Rand(const TInt aLow, const TInt aHigh, TInt64& aSeed)
       
    25 	{
       
    26 	TReal initialRand = (Math::FRand(aSeed) * (aHigh - aLow));
       
    27 	TInt32 rand;
       
    28 
       
    29 	// Round to 0 decimal places, ie. the nearest whole numer
       
    30 	Math::Round(initialRand, initialRand, 0);
       
    31 	Math::Int(rand, initialRand);
       
    32 
       
    33 	//aSeed = seed;
       
    34 	return (aLow + rand);
       
    35 	}
       
    36 
       
    37 #endif