testexecfw/stf/examples/MigrationExample/FileStore/TEF_STEP/src/TestFSPanicExample.cpp
author Johnson Ma <johnson.ma@nokia.com>
Fri, 09 Apr 2010 10:46:28 +0800
changeset 2 8bb370ba6d1d
permissions -rw-r--r--
contribute STF 1.0.0

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
* 
* Description:
*
*/
#include "TestFSPanicExample.h"

_LIT(KPanicString, "panicString");
_LIT(KPanicCode, "panicCode");

CTestFSPanicExample::CTestFSPanicExample()
    {
    // TODO Auto-generated constructor stub
    SetTestStepName(KPanicExample);
    }

CTestFSPanicExample::~CTestFSPanicExample()
    {
    // TODO Auto-generated destructor stub
    }


TVerdict CTestFSPanicExample::doTestStepL()
    {
    TInt panicCode = 0;
    if (GetIntFromConfig(ConfigSection(), KPanicCode, panicCode))
        {
        INFO_PRINTF2(_L("Expected Panic Code= %d"), panicCode);
        }
    else
        {
        ERR_PRINTF1(_L("Panic Code not set"));
        SetTestStepResult(EFail);
        }
    // Get file or directory name
    TPtrC panicString;
    if (GetStringFromConfig(ConfigSection(), KPanicString, panicString))
        {
        INFO_PRINTF2(_L("Expected Panic String= %S"), &panicString);
        }
    else
        {
        ERR_PRINTF1(_L("Panic String not set"));
        SetTestStepResult(EFail);
        }
    
    User::Panic(panicString, panicCode);    
    return TestStepResult();
    }