locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionUnitTestBlocks.cpp
author Billy Gibson <Billy.Gibson@nokia.com>
Fri, 28 May 2010 18:01:03 +0100
branchGeoConversion
changeset 34 0c0ad64c882c
permissions -rw-r--r--
Updated version of the Location Monitor supporting the new New GeoConversion interfaces. Also includes API help information
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     1
/*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     8
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    11
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    12
* Contributors:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    13
* 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    14
* Description: This file contains testclass implementation.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    15
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    16
*/
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    17
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    18
// [INCLUDE FILES] - do not remove
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    19
#include <e32svr.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    20
#include <StifParser.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    21
#include <Stiftestinterface.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    22
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    23
#include "LocInfoConversionUnitTest.h"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    24
#include "rlbslocmonitorsession.h"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    25
#include "rlbslocinfoconverter.h"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    26
#include "rlbslocmonitorareapositioner.h"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    27
#include <lbs/lbslocationinfo.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    28
#include <lbs/lbslocationcommon.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    29
#include "lbsposition.h"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    30
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    31
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    32
// Plug in 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    33
const TInt KDummyPluginId = 537007117;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    34
const TInt KSuplPluginId = 537028467;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    35
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    36
// ============================ MEMBER FUNCTIONS ===============================
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    37
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    38
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    39
// CLocInfoConversionUnitTest::Delete
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    40
// Delete here all resources allocated and opened from test methods. 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    41
// Called from destructor. 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    42
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    43
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    44
void CLocInfoConversionUnitTest::Delete() 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    45
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    46
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    47
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    48
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    49
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    50
// CLocInfoConversionUnitTest::RunMethodL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    51
// Run specified method. Contains also table of test mothods and their names.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    52
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    53
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    54
TInt CLocInfoConversionUnitTest::RunMethodL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    55
    CStifItemParser& aItem ) 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    56
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    57
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    58
    static TStifFunctionInfo const KFunctions[] =
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    59
        {  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    60
        ENTRY( "UnitTest1", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    61
        ENTRY( "UnitTest2", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect2L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    62
        ENTRY( "UnitTest3", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo1L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    63
        ENTRY( "UnitTest4", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo2L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    64
        ENTRY( "UnitTest5", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo3L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    65
        ENTRY( "UnitTest6", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo4L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    66
        ENTRY( "UnitTest7", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo5L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    67
        ENTRY( "UnitTest8", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo6L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    68
        ENTRY( "UnitTest9", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo7L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    69
        ENTRY( "UnitTest10", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo8L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    70
        ENTRY( "UnitTest11", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo9L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    71
        ENTRY( "UnitTest12", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo10L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    72
        ENTRY( "UnitTest13", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel1L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    73
        ENTRY( "UnitTest14", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel2L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    74
        ENTRY( "UnitTest15", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel3L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    75
        ENTRY( "UnitTest16", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel4L ),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    76
        };
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    77
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    78
    const TInt count = sizeof( KFunctions ) / 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    79
                        sizeof( TStifFunctionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    80
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    81
    return RunInternalL( KFunctions, count, aItem );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    82
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    83
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    84
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    85
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    86
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    87
// simple session and subsession.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    88
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    89
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    90
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    91
   {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    92
   TInt error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    93
   RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    94
   error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    95
   if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    96
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    97
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    98
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    99
   CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   100
   RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   101
   CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   102
   locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   103
   locInfoConverter.Close();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   104
   CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   105
   return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   106
   }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   107
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   108
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   109
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect2
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   110
// Opening multiple subsession from single session
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   111
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   112
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   113
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect2L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   114
   {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   115
   RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   116
   TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   117
   if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   118
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   119
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   120
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   121
   CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   122
   RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   123
   CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   124
   RLbsLocInfoConverter locInfoConverter1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   125
   CleanupClosePushL( locInfoConverter1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   126
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   127
   locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   128
   locInfoConverter1.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   129
   locInfoConverter.Close();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   130
   locInfoConverter1.Close();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   131
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   132
   CleanupStack::PopAndDestroy( 3 ); //locInfoConverter1,locInfoConverter and
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   133
                                     //locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   134
   return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   135
   }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   136
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   137
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   138
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   139
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo1L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   140
// This test case tests the simple and corner case related 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   141
// to RLbsLocInfoConverter::ConvertLocationInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   142
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   143
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   144
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo1L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   145
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   146
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   147
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   148
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   149
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   150
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   151
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   152
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   153
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   154
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   155
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   156
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   157
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   158
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   159
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   160
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   161
     * Case 1: where NULL pointer is passed instead of location info
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   162
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   163
    error = KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   164
    CLbsLocationInfo* locationInfo = CLbsLocationInfo::NewL();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   165
    CleanupStack::PushL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   166
    TRAP( error,locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   167
                  *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   168
                  conversionModuleId,iConversionHandler->iStatus ));
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   169
    if( error!= KErrArgument )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   170
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   171
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   172
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   173
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   174
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   175
     * Case 2: where we pass location info.This is
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   176
     * just test where this method completes without leaving.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   177
     */ 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   178
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   179
    // Here we append gsmcell info object to the existing location info object.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   180
    AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   181
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   182
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   183
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   184
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   185
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   186
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   187
    iConversionHandler->Cancel();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   188
    CleanupStack::PopAndDestroy( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   189
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   190
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   191
     * Case 3. Empty location info array is passed.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   192
     */  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   193
    error = KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   194
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   195
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   196
    TRAP( error,locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   197
            locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   198
            ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ));
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   199
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   200
    if( error != KErrArgument )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   201
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   202
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   203
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   204
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   205
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   206
     * Case 4: where we pass location info array.This is 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   207
     * just test where this method completes without leaving.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   208
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   209
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   210
    // Here we create locationInfo object with gsm cell info object contained in it.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   211
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   212
    locationInfoArray.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   213
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   214
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   215
                locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   216
                ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus  );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   217
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   218
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   219
    iConversionHandler->Cancel();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   220
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   221
    CleanupStack::Pop( 2 ); //locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   222
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   223
    CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   224
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   225
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   226
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   227
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   228
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo2L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   229
// This test case tests ConvertLocationInfo when expected information is
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   230
// of type ECoordinate
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   231
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   232
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   233
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo2L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   234
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   235
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   236
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   237
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   238
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   239
        return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   240
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   241
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   242
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   243
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   244
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   245
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   246
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   247
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   248
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   249
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   250
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   251
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   252
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   253
     *  case 1: Any information regarding the area is passed and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   254
     *  coordinate corresponding to that area info is expected.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   255
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   256
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   257
    // Here GSM cell info is passed as input area.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   258
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   259
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   260
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   261
                  *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   262
                  ,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   263
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   264
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   265
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   266
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   267
    // If the conversion status is KErrNone, check for the corresponding 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   268
    // converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   269
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   270
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   271
        CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   272
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   273
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   274
    else if( !( error == KErrNotSupported || error == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   275
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   276
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   277
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   278
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   279
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   280
     * case 2: Pass any information related to multiple area and we expect coordinate information
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   281
     * corresponding to each area information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   282
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   283
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   284
    // Create one more location info object which holds wlan info for which corresponding coordinate
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   285
    // is expected.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   286
    CLbsLocationInfo* locationInfo2 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   287
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   288
    // Before pushing location info object, remove the converted info from it.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   289
    // We had requested for coordinate info, hence we need to clear it before
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   290
    // we use it as input for next conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   291
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   292
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   293
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   294
    locationInfoArray.Append( locationInfo2 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   295
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   296
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   297
            locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   298
            ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   299
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   300
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   301
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   302
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   303
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   304
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   305
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   306
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   307
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   308
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   309
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   310
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   311
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   312
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   313
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   314
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   315
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   316
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   317
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   318
    else if( !( error == KErrNotSupported || error == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   319
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   320
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   321
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   322
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   323
    CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   324
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   325
    CleanupStack::PopAndDestroy( 2 );  // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   326
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   327
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   328
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   329
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   330
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   331
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo3L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   332
// This test case tests ConvertLocationInfo when expected information is
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   333
// of type EGsm
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   334
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   335
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   336
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo3L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   337
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   338
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   339
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   340
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   341
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   342
        return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   343
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   344
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   345
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   346
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   347
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   348
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   349
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   350
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   351
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   352
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   353
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   354
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   355
     * case 1: Pass any area info and we expect GSM cell info
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   356
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   357
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   358
    // Here WLAN info is passed as input area.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   359
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   360
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   361
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   362
                  *locationInfo,ELbsConversionCacheOnly,ELbsConversionOutputGsm,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   363
                  conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   364
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   365
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   366
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   367
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   368
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   369
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   370
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   371
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   372
    // If the conversion status is success, check for the corresponding 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   373
    // converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   374
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   375
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   376
        CheckGsmCellConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   377
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   378
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   379
    else if( !( error == KErrNotSupported || error == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   380
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   381
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   382
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   383
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   384
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   385
     * case 2: Pass any information related to multiple area and we expect GSM cell info
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   386
     * corresponding to each area information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   387
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   388
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   389
    // Create one more location info object which holds coordinate info for which corresponding GSM
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   390
    // cell info is expected.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   391
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   392
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   393
    // Before pushing location info object, remove the converted info from it.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   394
    // We had requested for GSM cell info, hence we need to clear it before
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   395
    // we use it for next conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   396
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsGsmInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   397
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   398
    locationInfoArray.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   399
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   400
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   401
            locationInfoArray,ELbsConversionCacheOnly,ELbsConversionOutputGsm,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   402
            conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   403
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   404
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   405
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   406
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   407
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   408
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   409
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   410
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   411
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   412
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   413
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   414
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   415
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   416
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   417
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   418
            CheckGsmCellConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   419
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   420
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   421
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   422
    else if( !( error == KErrNotSupported || error == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   423
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   424
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   425
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   426
    CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   427
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   428
    CleanupStack::PopAndDestroy( 2 );  // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   429
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   430
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   431
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   432
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   433
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   434
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo4L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   435
//This test case tests ConvertLocationInfo when expected information is
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   436
// of type EWcdma
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   437
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   438
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   439
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo4L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   440
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   441
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   442
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   443
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   444
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   445
        return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   446
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   447
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   448
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   449
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   450
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   451
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   452
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   453
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   454
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   455
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   456
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   457
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   458
     *  case 1: Pass any area info pointer and we expect EWcdma type
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   459
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   460
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   461
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   462
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   463
                  *locationInfo,ELbsConversionSilent,ELbsConversionOutputWcdma,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   464
                   conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   465
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   466
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   467
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   468
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   469
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   470
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   471
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   472
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   473
    // If the conversion status is success, check for the corresponding 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   474
    // converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   475
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   476
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   477
        CheckWcdmaCellConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   478
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   479
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   480
    else if( !( error == KErrNotSupported || error == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   481
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   482
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   483
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   484
  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   485
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   486
     *  case 2: Pass any information related to multiple area and we expect wcdma information
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   487
     * corresponding to each area information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   488
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   489
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   490
    // Create one more location info object which holds wlan info for which corresponding WCDMA 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   491
    // cell info is expected.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   492
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   493
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   494
    // Before pushing location info object, remove the converted info from it.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   495
    // We had requested for WCDMA info, hence we need to clear it before
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   496
    // we use it as input for next conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   497
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWcdmaInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   498
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   499
    locationInfoArray.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   500
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   501
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   502
            locationInfoArray,ELbsConversionSilent,ELbsConversionOutputWcdma,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   503
            conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   504
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   505
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   506
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   507
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   508
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   509
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   510
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   511
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   512
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   513
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   514
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   515
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   516
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   517
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   518
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   519
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   520
            CheckWcdmaCellConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   521
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   522
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   523
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   524
    else if( !( error == KErrNotSupported || error == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   525
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   526
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   527
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   528
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   529
    CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   530
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   531
    CleanupStack::PopAndDestroy( 2 );  // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   532
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   533
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   534
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   535
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   536
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   537
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo5L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   538
// This test case tests ConvertLocationInfo when expected information is
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   539
// of type EWlan
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   540
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   541
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   542
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo5L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   543
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   544
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   545
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   546
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   547
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   548
        return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   549
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   550
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   551
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   552
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   553
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   554
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   555
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   556
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   557
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   558
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   559
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   560
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   561
     * case 1: Pass any area info pointer and we expect EWlan type
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   562
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   563
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   564
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   565
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   566
                  *locationInfo,ELbsConversionCacheOnly,ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   567
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   568
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   569
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   570
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   571
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   572
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   573
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   574
    // If the conversion status is success, check for the corresponding 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   575
    // converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   576
    if( iConversionHandler->iStatus == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   577
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   578
        CheckWlanConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   579
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   580
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   581
    else if( !( iConversionHandler->iStatus == KErrNotSupported || iConversionHandler->iStatus == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   582
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   583
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   584
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   585
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   586
   /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   587
    * Case 2: Pass any information related to multiple area and we expect Wlan info
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   588
    * corresponding to each area information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   589
    */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   590
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   591
    // Create one more location info object which holds coordinate info for which corresponding 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   592
    // Wlan info is expected.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   593
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   594
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   595
    // Before pushing location info object, remove the converted info from it.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   596
    // We had requested for wlan info, hence we need to clear it before
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   597
    // we use it for next conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   598
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   599
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   600
    locationInfoArray.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   601
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   602
    TRequestStatus status;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   603
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   604
            locationInfoArray,ELbsConversionCacheOnly,ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   605
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   606
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   607
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   608
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   609
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   610
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   611
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   612
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   613
    if( iConversionHandler->iStatus == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   614
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   615
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   616
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   617
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   618
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   619
            CheckWlanConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   620
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   621
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   622
    // KErrNotSupported and KErrNotFound are allowed error codes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   623
    else if( !( iConversionHandler->iStatus == KErrNotSupported || iConversionHandler->iStatus == KErrNotFound ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   624
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   625
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   626
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   627
    CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   628
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   629
    CleanupStack::PopAndDestroy( 2 );  // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   630
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   631
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   632
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   633
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   634
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo6L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   635
// This test case tests the scenario when user tries to request new single 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   636
// conversion without waiting for completion of previous one.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   637
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   638
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   639
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo6L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   640
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   641
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   642
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   643
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   644
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   645
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   646
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   647
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   648
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   649
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   650
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   651
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   652
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   653
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   654
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   655
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   656
    // Here in this case input area doesnt matter 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   657
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   658
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   659
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   660
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   661
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   662
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   663
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   664
    error = KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   665
    TRequestStatus status;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   666
    TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   667
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   668
          *locationInfo1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   669
          ELbsConversionOutputPosition,conversionModuleId,status );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   670
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   671
    CleanupStack::PopAndDestroy( 2 ); // locationInfo1,locationInfo
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   672
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   673
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   674
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   675
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   676
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo7L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   677
// This test case tests the scenario when user tries to request new batch 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   678
// conversion without waiting for completion of previous one.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   679
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   680
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   681
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo7L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   682
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   683
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   684
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   685
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   686
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   687
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   688
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   689
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   690
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   691
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   692
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   693
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   694
    TUid conversionModuleId = TUid::Uid( KNullUidValue );;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   695
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   696
    // Here in this case input area doesnt matter 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   697
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   698
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   699
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   700
    RPointerArray<CLbsLocationInfoBase> locationInfoArray1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   701
    CleanupClosePushL( locationInfoArray1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   702
      
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   703
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   704
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   705
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   706
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   707
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   708
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   709
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   710
                locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   711
                ELbsConversionOutputPosition,conversionModuleId ,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   712
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   713
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   714
    locationInfoArray1.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   715
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   716
    TRequestStatus status;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   717
    TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   718
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   719
            locationInfoArray1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   720
            ELbsConversionOutputPosition,conversionModuleId,status );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   721
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   722
    CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   723
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   724
    locationInfoArray1.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   725
    CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   726
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   727
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   728
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   729
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   730
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   731
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo8L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   732
// This test case tests the scenario when user tries to request two conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   733
// using two subsessions simultaneously specifying same plugin.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   734
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   735
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   736
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo8L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   737
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   738
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   739
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   740
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   741
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   742
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   743
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   744
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   745
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   746
    // Here we need to open two subsessions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   747
    RLbsLocInfoConverter locInfoConverter,locInfoConverter1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   748
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   749
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   750
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   751
    CleanupClosePushL( locInfoConverter1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   752
    locInfoConverter1.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   753
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   754
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   755
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   756
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   757
    RPointerArray<CLbsLocationInfoBase> locationInfoArray1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   758
    CleanupClosePushL( locationInfoArray1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   759
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   760
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   761
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   762
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   763
     * Case 1: Users tries to request 2 simultaneous single conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   764
     *         using 2 subsession specifying same conversion uid.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   765
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   766
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   767
    // Here type of area input doesnt matter.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   768
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   769
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   770
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   771
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   772
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   773
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   774
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   775
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   776
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   777
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   778
          *locationInfo1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   779
          ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   780
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   781
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   782
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   783
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   784
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   785
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   786
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   787
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   788
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   789
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   790
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   791
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   792
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   793
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   794
        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   795
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   796
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   797
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   798
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   799
        CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   800
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   801
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   802
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   803
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   804
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   805
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   806
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   807
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   808
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   809
        CheckPositionConvertedInfoL( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   810
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   811
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   812
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   813
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   814
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   815
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   816
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   817
     * Case 2: Users tries to request 2 simultaneous bulk conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   818
     *         using 2 subsession specifying same conversion uid.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   819
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   820
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   821
    // Before we append the location info object to the info array,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   822
    // we need to clear the converted info in each object.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   823
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   824
    locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   825
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   826
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   827
    locationInfoArray1.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   828
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   829
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   830
                  locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   831
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   832
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   833
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   834
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   835
            locationInfoArray1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   836
          ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   837
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   838
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   839
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   840
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   841
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   842
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   843
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   844
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   845
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   846
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   847
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   848
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   849
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   850
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   851
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   852
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   853
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   854
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   855
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   856
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   857
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   858
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   859
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   860
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   861
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   862
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   863
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   864
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   865
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   866
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   867
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   868
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   869
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   870
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   871
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   872
        for( TInt i=0;i<locationInfoArray1.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   873
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   874
            CLbsLocationInfoBase* locationInfobase = locationInfoArray1[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   875
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   876
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   877
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   878
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   879
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   880
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   881
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   882
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   883
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   884
    CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   885
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   886
    locationInfoArray1.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   887
    CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   888
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   889
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   890
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   891
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   892
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   893
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo9L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   894
// This test case tests the scenario when user tries to request two conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   895
// using two subsessions simultaneously specifying different plugin.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   896
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   897
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   898
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo9L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   899
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   900
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   901
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   902
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   903
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   904
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   905
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   906
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   907
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   908
    // Here we need two subsessions
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   909
    RLbsLocInfoConverter locInfoConverter,locInfoConverter1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   910
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   911
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   912
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   913
    CleanupClosePushL( locInfoConverter1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   914
    locInfoConverter1.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   915
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   916
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   917
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   918
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   919
    RPointerArray<CLbsLocationInfoBase> locationInfoArray1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   920
    CleanupClosePushL( locationInfoArray1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   921
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   922
    TUid conversionModuleId1 = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   923
    TUid conversionModuleId2 = TUid::Uid( KSuplPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   924
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   925
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   926
     * Case 1: Users tries to request 2 simultaneous single conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   927
     *         using 2 subsession specifying different conversion uid.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   928
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   929
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   930
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   931
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   932
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   933
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   934
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   935
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   936
                  ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   937
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   938
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   939
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   940
          *locationInfo1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   941
          ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   942
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   943
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   944
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   945
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   946
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   947
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   948
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   949
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   950
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   951
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   952
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   953
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   954
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   955
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   956
        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   957
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   958
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   959
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   960
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   961
        CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   962
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   963
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   964
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   965
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   966
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   967
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   968
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   969
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   970
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   971
        CheckPositionConvertedInfoL( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   972
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   973
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   974
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   975
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   976
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   977
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   978
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   979
     * Case 2: Users tries to request 2 simultaneous bulk conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   980
     *         using 2 subsession specifying same conversion uid.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   981
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   982
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   983
    // Before we append the location info object to the info array,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   984
    // we need to clear the converted info in each object.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   985
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   986
    locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   987
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   988
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   989
    locationInfoArray1.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   990
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   991
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   992
                  locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   993
                  ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   994
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   995
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   996
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   997
            locationInfoArray1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   998
          ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   999
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1000
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1001
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1002
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1003
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1004
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1005
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1006
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1007
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1008
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1009
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1010
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1011
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1012
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1013
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1014
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1015
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1016
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1017
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1018
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1019
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1020
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1021
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1022
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1023
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1024
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1025
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1026
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1027
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1028
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1029
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1030
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1031
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1032
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1033
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1034
        for( TInt i=0;i<locationInfoArray1.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1035
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1036
            CLbsLocationInfoBase* locationInfobase = locationInfoArray1[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1037
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1038
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1039
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1040
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1041
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1042
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1043
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1044
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1045
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1046
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1047
    CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1048
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1049
    locationInfoArray1.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1050
    CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1051
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1052
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1053
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1054
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1055
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo10L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1056
// This test case tests following unsuccessful conversion scenarios:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1057
// 1. Conversion preference not supported by plugin.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1058
// 2. Conversion request by specifying input area type same as requested type. 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1059
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1060
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1061
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo10L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1062
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1063
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1064
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1065
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1066
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1067
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1068
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1069
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1070
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1071
    // Here we need two subsessions
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1072
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1073
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1074
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1075
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1076
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1077
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1078
     * Case 1: Users tries to request conversion by specifying conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1079
     *         preference not supported by plugin. Example plugin doesnt 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1080
     *         support conversion using cache.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1081
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1082
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1083
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1084
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1085
                  *locationInfo,ELbsConversionCacheOnly,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1086
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1087
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1088
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1089
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1090
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1091
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1092
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1093
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1094
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1095
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1096
    if( error != KErrNotSupported )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1097
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1098
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1099
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1100
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1101
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1102
     * Case 2: Users tries to request for coordinate info by specifying
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1103
     *         only coordinate info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1104
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1105
    locationInfo->ResetAreaInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1106
    AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaPositionInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1107
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1108
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1109
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1110
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1111
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1112
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1113
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1114
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1115
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1116
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1117
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1118
    if( error != KErrNotSupported )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1119
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1120
        User::Leave( KErrArgument );    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1121
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1122
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1123
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1124
     * Case 3: Users tries to request for gsm cell info by specifying
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1125
     *         only gsm cell info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1126
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1127
    locationInfo->ResetAreaInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1128
    AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1129
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1130
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1131
                  ELbsConversionOutputGsm,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1132
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1133
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1134
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1135
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1136
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1137
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1138
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1139
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1140
    if( error != KErrNotSupported )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1141
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1142
        User::Leave( KErrArgument );    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1143
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1144
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1145
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1146
     * Case 4: Users tries to request for wcdma cell info by specifying
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1147
     *         only wcdma cell info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1148
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1149
    locationInfo->ResetAreaInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1150
    AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaWcmdaCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1151
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1152
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1153
                  ELbsConversionOutputWcdma,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1154
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1155
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1156
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1157
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1158
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1159
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1160
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1161
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1162
    if( error != KErrNotSupported )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1163
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1164
        User::Leave( KErrArgument );    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1165
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1166
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1167
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1168
     * Case 5: Users tries to request for wlan info by specifying
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1169
     *         only wlan info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1170
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1171
    locationInfo->ResetAreaInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1172
    AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1173
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1174
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1175
                  ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1176
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1177
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1178
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1179
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1180
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1181
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1182
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1183
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1184
    if( error != KErrNotSupported )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1185
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1186
        User::Leave( KErrArgument );    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1187
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1188
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1189
    CleanupStack::PopAndDestroy( 3 ); // locationInfo,locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1190
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1191
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1192
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1193
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1194
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1195
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1196
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel1L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1197
// This test case tests the scenario when user tries to cancel the request before 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1198
// and after the conversion request complete for both single and batch conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1199
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1200
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1201
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel1L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1202
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1203
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1204
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1205
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1206
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1207
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1208
        return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1209
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1210
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1211
    RLbsLocInfoConverter locInfoConverter;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1212
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1213
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1214
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1215
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1216
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1217
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1218
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1219
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1220
    // This can  can be done for any area type here EGsm to ECoordinate conversion has 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1221
    // been used.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1222
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1223
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1224
     * Case 1: Here single location information conversion is requested 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1225
     *         and cancel is called before the conversion completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1226
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1227
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1228
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1229
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1230
                  *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1231
                  ,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1232
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1233
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1234
    iConversionHandler->Cancel();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1235
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1236
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1237
    // Request should be completed with the error code KErrCancel and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1238
    // location info should not have converted information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1239
    if( error == KErrCancel )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1240
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1241
        CheckPositionConvertedInfoL( locationInfo,ENegative );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1242
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1243
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1244
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1245
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1246
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1247
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1248
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1249
     *  case 2: Here single location information conversion is requested
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1250
     *          and cancel is called after the conversion completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1251
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1252
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1253
                  *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1254
                  ,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1255
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1256
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1257
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1258
    iConversionHandler->Cancel();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1259
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1260
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1261
    // Request should be completed with the error code KErrNone and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1262
    // location info should have converted information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1263
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1264
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1265
        CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1266
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1267
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1268
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1269
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1270
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1271
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1272
    // case 3: Here mutiple location information conversion is 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1273
    // requested and cancel is called before the conversion completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1274
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1275
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1276
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1277
    // We had requested for coordinate info, hence we need to clear it before
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1278
    // we use it as input for next conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1279
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1280
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1281
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1282
    locationInfoArray.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1283
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1284
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1285
            locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1286
            ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1287
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1288
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1289
    iConversionHandler->Cancel();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1290
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1291
    // Request should be completed with the error code KErrCancel and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1292
    // location info should not have converted information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1293
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1294
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1295
    if( error == KErrCancel )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1296
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1297
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1298
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1299
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1300
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1301
            CheckPositionConvertedInfoL( locationInfo,ENegative );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1302
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1303
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1304
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1305
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1306
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1307
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1308
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1309
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1310
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1311
     *  case 4: Here mutiple location information conversion is 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1312
     * requested and cancel is called after the conversion completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1313
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1314
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1315
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1316
            locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1317
            ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1318
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1319
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1320
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1321
    iConversionHandler->Cancel();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1322
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1323
    // Request should be completed with the error code KErrNone and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1324
    // location info should have converted information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1325
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1326
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1327
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1328
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1329
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1330
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1331
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1332
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1333
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1334
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1335
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1336
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1337
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1338
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1339
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1340
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1341
    CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1342
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1343
    CleanupStack::PopAndDestroy( 2 );  // locInfoConverter,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1344
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1345
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1346
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1347
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1348
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1349
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1350
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel2L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1351
// This test case tests the scenario when user tries to cancel the conversion request
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1352
// from the different subsession for both single and multiple conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1353
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1354
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1355
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel2L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1356
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1357
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1358
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1359
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1360
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1361
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1362
        return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1363
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1364
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1365
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1366
    // Here we need to subsessions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1367
    RLbsLocInfoConverter locInfoConverter,locInfoConverter1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1368
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1369
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1370
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1371
    CleanupClosePushL( locInfoConverter1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1372
    locInfoConverter1.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1373
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1374
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1375
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1376
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1377
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1378
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1379
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1380
    // This can  can be done for any area type here EGsm to ECoordinate conversion has 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1381
    // been used.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1382
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1383
    /** 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1384
     * Case 1: Here single location information conversion is 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1385
     *         requested and cancel is called the different subsession.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1386
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1387
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1388
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1389
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1390
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1391
                  *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1392
                  ,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1393
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1394
    locInfoConverter1.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1395
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1396
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1397
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1398
    // Request should be completed with the error code KErrNone and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1399
    // location info should have converted information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1400
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1401
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1402
        CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1403
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1404
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1405
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1406
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1407
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1408
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1409
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1410
     * Case 2: Here mutiple location information conversion is requested 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1411
     *         and cancel is called from the different subsession.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1412
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1413
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1414
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1415
    // We had requested for coordinate info, hence we need to clear it before
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1416
    // we use it as input for next conversion.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1417
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1418
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1419
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1420
    locationInfoArray.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1421
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1422
    locInfoConverter.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1423
            locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1424
            ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1425
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1426
    locInfoConverter1.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1427
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1428
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1429
    // Request should be completed with the error code KErrNone and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1430
    // location info should have converted information.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1431
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1432
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1433
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1434
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1435
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1436
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1437
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1438
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1439
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1440
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1441
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1442
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1443
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1444
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1445
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1446
    CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1447
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1448
    CleanupStack::PopAndDestroy( 3 );  // locInfoConverter,locInfoConverter1,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1449
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1450
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1451
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1452
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1453
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel3L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1454
// This test case tests the scenario when user tries to request two conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1455
// using two subsessions simultaneously specifying same plugin and we cancel one request
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1456
// of two requests.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1457
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1458
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1459
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel3L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1460
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1461
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1462
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1463
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1464
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1465
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1466
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1467
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1468
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1469
    // Here we need to open two subsessions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1470
    RLbsLocInfoConverter locInfoConverter,locInfoConverter1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1471
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1472
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1473
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1474
    CleanupClosePushL( locInfoConverter1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1475
    locInfoConverter1.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1476
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1477
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1478
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1479
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1480
    RPointerArray<CLbsLocationInfoBase> locationInfoArray1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1481
    CleanupClosePushL( locationInfoArray1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1482
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1483
    TUid conversionModuleId = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1484
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1485
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1486
     * Case 1: Users tries to request 2 simultaneous single conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1487
     *         using 2 subsession specifying same conversion uid and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1488
     *         anyone conversion request is cancelled.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1489
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1490
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1491
    // Here type of area input doesnt matter.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1492
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1493
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1494
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1495
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1496
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1497
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1498
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1499
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1500
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1501
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1502
          *locationInfo1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1503
          ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1504
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1505
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1506
    // Here first request is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1507
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1508
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1509
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1510
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1511
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1512
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1513
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1514
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1515
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1516
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1517
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1518
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1519
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1520
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1521
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1522
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1523
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1524
    if( error == KErrCancel )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1525
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1526
        CheckPositionConvertedInfoL( locationInfo,ENegative );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1527
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1528
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1529
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1530
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1531
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1532
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1533
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1534
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1535
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1536
        CheckPositionConvertedInfoL( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1537
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1538
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1539
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1540
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1541
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1542
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1543
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1544
     * Case 2: Users tries to request 2 simultaneous bulk conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1545
     *         using 2 subsession specifying same conversion uid and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1546
     *         any one conversion request is cancelled.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1547
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1548
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1549
    // Before we append the location info object to the info array,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1550
    // we need to clear the converted info in each object.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1551
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1552
    locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1553
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1554
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1555
    locationInfoArray1.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1556
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1557
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1558
                  locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1559
                  ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1560
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1561
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1562
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1563
            locationInfoArray1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1564
          ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1565
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1566
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1567
    // Here second request is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1568
    locInfoConverter1.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1569
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1570
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1571
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1572
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1573
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1574
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1575
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1576
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1577
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1578
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1579
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1580
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1581
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1582
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1583
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1584
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1585
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1586
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1587
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1588
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1589
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1590
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1591
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1592
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1593
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1594
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1595
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1596
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1597
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1598
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1599
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1600
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1601
    if( error == KErrCancel )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1602
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1603
        for( TInt i=0;i<locationInfoArray1.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1604
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1605
            CLbsLocationInfoBase* locationInfobase = locationInfoArray1[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1606
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1607
            CheckPositionConvertedInfoL( locationInfo,ENegative );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1608
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1609
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1610
    else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1611
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1612
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1613
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1614
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1615
    CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1616
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1617
    locationInfoArray1.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1618
    CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1619
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1620
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1621
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1622
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1623
// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel4L
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1624
// This test case tests the scenario when user tries to request two conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1625
// using two subsessions simultaneously specifying different plugin.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1626
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1627
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1628
TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel4L(CStifItemParser& /*aItem*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1629
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1630
    RLbsLocMonitorSession locMonitorSession;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1631
    TInt error = locMonitorSession.Connect();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1632
    if( error != KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1633
       {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1634
       return error;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1635
       }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1636
    CleanupClosePushL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1637
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1638
    // Here we need two subsessions
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1639
    RLbsLocInfoConverter locInfoConverter,locInfoConverter1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1640
    CleanupClosePushL( locInfoConverter );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1641
    locInfoConverter.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1642
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1643
    CleanupClosePushL( locInfoConverter1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1644
    locInfoConverter1.OpenL( locMonitorSession );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1645
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1646
    RPointerArray<CLbsLocationInfoBase> locationInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1647
    CleanupClosePushL( locationInfoArray );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1648
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1649
    RPointerArray<CLbsLocationInfoBase> locationInfoArray1;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1650
    CleanupClosePushL( locationInfoArray1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1651
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1652
    TUid conversionModuleId1 = TUid::Uid( KDummyPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1653
    TUid conversionModuleId2 = TUid::Uid( KSuplPluginId );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1654
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1655
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1656
     * Case 1: Users tries to request 2 simultaneous single conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1657
     *         using 2 subsession specifying different conversion uid
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1658
     *         any one request is cancelled.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1659
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1660
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1661
    CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1662
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1663
    CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1664
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1665
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1666
                  *locationInfo,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1667
                  ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1668
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1669
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1670
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1671
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1672
          *locationInfo1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1673
          ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1674
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1675
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1676
    // Here first request is cancelled.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1677
    locInfoConverter.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1678
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1679
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1680
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1681
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1682
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1683
   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1684
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1685
    // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1686
    if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1687
        iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1688
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1689
        CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1690
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1691
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1692
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1693
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1694
    if( error == KErrCancel )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1695
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1696
        CheckPositionConvertedInfoL( locationInfo,ENegative );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1697
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1698
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1699
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1700
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1701
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1702
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1703
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1704
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1705
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1706
        CheckPositionConvertedInfoL( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1707
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1708
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1709
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1710
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1711
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1712
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1713
    /**
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1714
     * Case 2: Users tries to request 2 simultaneous bulk conversion
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1715
     *         using 2 subsession specifying same conversion uid and 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1716
     *         one conversion request is cancelled.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1717
     */
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1718
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1719
    // Before we append the location info object to the info array,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1720
    // we need to clear the converted info in each object.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1721
    locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1722
    locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1723
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1724
    locationInfoArray.Append( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1725
    locationInfoArray1.Append( locationInfo1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1726
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1727
    locInfoConverter.ConvertLocationInfoL(  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1728
                  locationInfoArray,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1729
                  ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1730
    iConversionHandler->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1731
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1732
    locInfoConverter1.ConvertLocationInfoL( 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1733
            locationInfoArray1,ELbsConversionNotDefined,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1734
          ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1735
    iConversionHandler1->Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1736
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1737
    // Here we cancel 2nd request 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1738
    locInfoConverter1.CancelConvertLocationInfo();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1739
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1740
    // This is just to block the control till the call back method is called.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1741
    // Code after this statement will be resumed when Stop on CActiveScheduler
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1742
    // is called in the HandleLocationConversion method.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1743
    CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1744
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1745
    // Here we need to wait till both the request completes.Hence we need to block it once again
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1746
     // till the 2nd request completes.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1747
     if( iConversionHandler->iStatus.Int() == KRequestPending || 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1748
         iConversionHandler1->iStatus.Int() == KRequestPending )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1749
         {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1750
         CActiveScheduler::Start();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1751
         }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1752
     
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1753
    // Check the converted values in both the conversions.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1754
    // Iterate through the array and check for converted info.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1755
    error = iConversionHandler->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1756
    if( error == KErrNone )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1757
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1758
        for( TInt i=0;i<locationInfoArray.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1759
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1760
            CLbsLocationInfoBase* locationInfobase = locationInfoArray[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1761
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1762
            CheckPositionConvertedInfoL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1763
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1764
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1765
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1766
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1767
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1768
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1769
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1770
    error = iConversionHandler1->iStatus.Int();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1771
    if( error == KErrCancel )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1772
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1773
        for( TInt i=0;i<locationInfoArray1.Count();i++ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1774
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1775
            CLbsLocationInfoBase* locationInfobase = locationInfoArray1[i];
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1776
            CLbsLocationInfo* locationInfo = static_cast<CLbsLocationInfo*> ( locationInfobase );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1777
            CheckPositionConvertedInfoL( locationInfo,ENegative );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1778
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1779
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1780
    else if( !( error == KErrNotFound || error == KErrNotSupported ) )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1781
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1782
        User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1783
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1784
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1785
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1786
    CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1787
    locationInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1788
    locationInfoArray1.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1789
    CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1790
    return KErrNone;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1791
    }   
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1792
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1793
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1794
// Helper methods
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1795
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1796
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1797
// CLocInfoConversionUnitTest::CreatePositionObjectLC
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1798
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1799
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1800
CLbsPositionInfo* CLocInfoConversionUnitTest::CreatePositionInfoObjectLC()
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1801
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1802
    TLocality locality;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1803
    locality.SetCoordinate( 62.5285,23.9385 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1804
    locality.SetAccuracy( 100,0.0 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1805
    CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1806
    CleanupStack::PushL( positionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1807
    return positionInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1808
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1809
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1810
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1811
// CLocInfoConversionUnitTest::CreateGsmCellInfoObjectLC
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1812
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1813
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1814
CLbsGsmCellInfo* CLocInfoConversionUnitTest::CreateGsmCellInfoObjectLC()
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1815
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1816
    CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1817
    CleanupStack::PushL( gsmCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1818
    return gsmCellInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1819
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1820
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1821
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1822
// CLocInfoConversionUnitTest::CreateWcdmaCellInfoObjectLC
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1823
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1824
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1825
CLbsWcdmaCellInfo* CLocInfoConversionUnitTest::CreateWcdmaCellInfoObjectLC()
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1826
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1827
    CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1828
    CleanupStack::PushL( wcdmaCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1829
    return wcdmaCellInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1830
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1831
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1832
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1833
// CLocInfoConversionUnitTest::CreateWlanInfoObjectLC
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1834
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1835
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1836
CLbsWlanInfo* CLocInfoConversionUnitTest::CreateWlanInfoObjectLC()
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1837
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1838
    TLbsWlanMacAddress macAddress(_L8("10.0.1"));
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1839
    CLbsWlanInfo* wlanInfo = CLbsWlanInfo::NewL( macAddress,10.1 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1840
    CleanupStack::PushL( wlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1841
    return wlanInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1842
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1843
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1844
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1845
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1846
// CLocInfoConversionUnitTest::CreateLocationInfoObjectLC
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1847
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1848
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1849
CLbsLocationInfo* CLocInfoConversionUnitTest::CreateLocationInfoObjectLC(                    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1850
                                                    TLbsAreaInfoClassType aAreaType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1851
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1852
    CLbsLocationInfo* locationInfo = CLbsLocationInfo::NewL();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1853
    CleanupStack::PushL( locationInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1854
    AppendAreaInfoObjectToLocationInfoL( locationInfo,aAreaType );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1855
    return locationInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1856
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1857
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1858
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1859
// CLocInfoConversionUnitTest::AppendAreaInfoObjectToLocationInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1860
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1861
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1862
void CLocInfoConversionUnitTest::AppendAreaInfoObjectToLocationInfoL(
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1863
                                                    CLbsLocationInfo* aLocationInfo,                    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1864
                                                    TLbsAreaInfoClassType aAreaType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1865
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1866
    switch( aAreaType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1867
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1868
        case ELbsAreaPositionInfoClass:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1869
            CLbsPositionInfo* positionInfo = NULL;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1870
            positionInfo = CreatePositionInfoObjectLC();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1871
            aLocationInfo->AddAreaInfoL( positionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1872
            CleanupStack::Pop( positionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1873
            break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1874
        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1875
        case ELbsAreaGsmCellInfoClass:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1876
            CLbsGsmCellInfo* gsmCellInfo = NULL;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1877
            gsmCellInfo = CreateGsmCellInfoObjectLC();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1878
            aLocationInfo->AddAreaInfoL( gsmCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1879
            CleanupStack::Pop( gsmCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1880
            break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1881
            
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1882
        case ELbsAreaWcmdaCellInfoClass:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1883
            CLbsWcdmaCellInfo* wcdmaCellInfo = NULL;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1884
            wcdmaCellInfo = CreateWcdmaCellInfoObjectLC();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1885
            aLocationInfo->AddAreaInfoL( wcdmaCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1886
            CleanupStack::Pop( wcdmaCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1887
            break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1888
            
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1889
        case ELbsAreaWlanInfoClass:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1890
            CLbsWlanInfo* wlanInfo = NULL;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1891
            wlanInfo = CreateWlanInfoObjectLC();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1892
            aLocationInfo->AddAreaInfoL( wlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1893
            CleanupStack::Pop( wlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1894
            break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1895
        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1896
        default:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1897
            break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1898
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1899
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1900
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1901
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1902
// CLocInfoConversionUnitTest::CheckPositionConvertedInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1903
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1904
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1905
void CLocInfoConversionUnitTest::CheckPositionConvertedInfoL( CLbsLocationInfo* 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1906
                                                              aLocationInfo,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1907
                                                              TTestType 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1908
                                                              aTestType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1909
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1910
    RLbsAreaInfoBaseArray areaInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1911
    aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsPosInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1912
    TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1913
    areaInfoArray.Reset();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1914
    if( aTestType == EPositive )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1915
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1916
        if( !count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1917
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1918
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1919
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1920
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1921
    else 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1922
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1923
        if( count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1924
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1925
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1926
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1927
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1928
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1929
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1930
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1931
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1932
// CLocInfoConversionUnitTest::CheckGsmCellConvertedInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1933
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1934
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1935
void CLocInfoConversionUnitTest::CheckGsmCellConvertedInfoL( CLbsLocationInfo* 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1936
                                                             aLocationInfo,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1937
                                                             TTestType 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1938
                                                             aTestType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1939
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1940
    RLbsAreaInfoBaseArray areaInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1941
    aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsGsmInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1942
    TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1943
    areaInfoArray.Reset();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1944
    if( aTestType == EPositive )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1945
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1946
        if( !count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1947
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1948
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1949
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1950
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1951
    else 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1952
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1953
        if( count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1954
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1955
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1956
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1957
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1958
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1959
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1960
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1961
// CLocInfoConversionUnitTest::CheckWcdmaCellConvertedInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1962
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1963
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1964
void CLocInfoConversionUnitTest::CheckWcdmaCellConvertedInfoL( CLbsLocationInfo* 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1965
                                                               aLocationInfo,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1966
                                                               TTestType 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1967
                                                               aTestType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1968
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1969
    RLbsAreaInfoBaseArray areaInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1970
    aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsWcdmaInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1971
    TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1972
    areaInfoArray.Reset();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1973
    if( aTestType == EPositive )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1974
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1975
        if( !count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1976
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1977
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1978
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1979
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1980
    else 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1981
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1982
        if( count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1983
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1984
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1985
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1986
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1987
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1988
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1989
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1990
// CLocInfoConversionUnitTest::CheckWlanConvertedInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1991
// -----------------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1992
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1993
void CLocInfoConversionUnitTest::CheckWlanConvertedInfoL( CLbsLocationInfo* 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1994
                                                          aLocationInfo,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1995
                                                          TTestType 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1996
                                                          aTestType )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1997
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1998
    RLbsAreaInfoBaseArray areaInfoArray;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  1999
    aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsWlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2000
    TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2001
    areaInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2002
    if( aTestType == EPositive )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2003
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2004
        if( !count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2005
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2006
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2007
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2008
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2009
    else 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2010
        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2011
        if( count )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2012
            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2013
            User::Leave( KErrArgument );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2014
            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2015
        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2016
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
  2017
//  [End of File]