camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.cpp
changeset 56 01e205c615b9
parent 48 42ba2d16bf40
equal deleted inserted replaced
48:42ba2d16bf40 56:01e205c615b9
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 #include <QTest>
    18 #include <QTest>
    19 
    19 
    20 #include "unittest_cxefeaturemanagerimp.h"
    20 #include "unittest_cxefeaturemanagerimp.h"
    21 #include "cxefeaturemanagerimp.h"
    21 #include "cxefeaturemanagerimp.h"
    22 #include "cxenamespace.h"
    22 #include "cxenamespace.h"
    23 #include "cxesettings.h"
    23 #include "cxefakesettings.h"
    24 
       
    25 
    24 
    26 static const char* INVALID_KEY = "invalid key";
    25 static const char* INVALID_KEY = "invalid key";
    27 static const char* EMPTY_KEY = "";
    26 static const char* EMPTY_KEY = "";
    28 
    27 
    29 
    28 
    30 UnitTestCxeFeatureManager::UnitTestCxeFeatureManager()
    29 UnitTestCxeFeatureManager::UnitTestCxeFeatureManager()
    31 : mFeatureManager(NULL)
    30 : mFeatureManager(NULL), mFakeSettings(NULL)
    32 {
    31 {
    33 }
    32 }
    34 
    33 
    35 UnitTestCxeFeatureManager::~UnitTestCxeFeatureManager()
    34 UnitTestCxeFeatureManager::~UnitTestCxeFeatureManager()
    36 {
    35 {
    38 }
    37 }
    39 
    38 
    40 // Run before each individual test case
    39 // Run before each individual test case
    41 void UnitTestCxeFeatureManager::init()
    40 void UnitTestCxeFeatureManager::init()
    42 {
    41 {
       
    42     mFakeSettings = new CxeFakeSettings();
    43     // fake model contains initialized test data.
    43     // fake model contains initialized test data.
    44     mFeatureManager = new CxeFeatureManagerImp(*mSettings);
    44     mFeatureManager = new CxeFeatureManagerImp(*mFakeSettings);
    45 }
    45 }
    46 
    46 
    47 // Run after each individual test case
    47 // Run after each individual test case
    48 void UnitTestCxeFeatureManager::cleanup()
    48 void UnitTestCxeFeatureManager::cleanup()
    49 {
    49 {
    50     delete mFeatureManager;
    50     delete mFeatureManager;
    51     mFeatureManager = 0;
    51     mFeatureManager = 0;
       
    52     delete mFakeSettings;
       
    53     mFakeSettings = NULL;
    52 }
    54 }
    53 
    55 
    54 // Testing that isFeatureSupported function returns correct values
    56 // Testing that isFeatureSupported function returns correct values
    55 void UnitTestCxeFeatureManager::testIsFeatureSupported()
    57 void UnitTestCxeFeatureManager::testIsFeatureSupported()
    56 {
    58 {