0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* Example CTestStep derived implementation
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
/**
|
|
22 |
@file WriteStringStep.cpp
|
|
23 |
*/
|
|
24 |
#include "PanicStep.h"
|
|
25 |
#include "Te_RegStepTestSuiteDefs.h"
|
|
26 |
|
|
27 |
CPanicTestStep::~CPanicTestStep()
|
|
28 |
/**
|
|
29 |
* Destructor
|
|
30 |
*/
|
|
31 |
{
|
|
32 |
}
|
|
33 |
|
|
34 |
CPanicTestStep::CPanicTestStep()
|
|
35 |
/**
|
|
36 |
* Constructor
|
|
37 |
*/
|
|
38 |
{
|
|
39 |
SetTestStepName(KPanicTestStep);
|
|
40 |
}
|
|
41 |
|
|
42 |
TVerdict CPanicTestStep::doTestStepPreambleL()
|
|
43 |
/**
|
|
44 |
* @return - TVerdict code
|
|
45 |
* Override of base class virtual
|
|
46 |
*/
|
|
47 |
{
|
|
48 |
// There is no initiation work so set this result to pass.
|
|
49 |
SetTestStepResult(EPass);
|
|
50 |
return TestStepResult();
|
|
51 |
}
|
|
52 |
|
|
53 |
|
|
54 |
TVerdict CPanicTestStep::doTestStepL()
|
|
55 |
/**
|
|
56 |
* @return - TVerdict code
|
|
57 |
* Override of base class pure virtual
|
|
58 |
* Our implementation only gets called if the base class doTestStepPreambleL() did
|
|
59 |
* not leave. That being the case, the current test result value will be EPass.
|
|
60 |
*/
|
|
61 |
{
|
|
62 |
SetTestStepResult(EFail);
|
|
63 |
INFO_PRINTF1(_L("This step tests the behavior of TEF when panic occurs."));
|
|
64 |
_LIT(KPanicString, "PanicString");
|
|
65 |
_LIT(KPanicCode, "PanicCode");
|
|
66 |
TPtrC panicString;
|
|
67 |
TInt panicCode;
|
|
68 |
GetStringFromConfig(ConfigSection(), KPanicString, panicString);
|
|
69 |
GetIntFromConfig(ConfigSection(), KPanicCode, panicCode);
|
|
70 |
User::Panic(panicString, panicCode);
|
|
71 |
|
|
72 |
// This line should never access.
|
|
73 |
return TestStepResult();
|
|
74 |
}
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
TVerdict CPanicTestStep::doTestStepPostambleL()
|
|
79 |
/**
|
|
80 |
* @return - TVerdict code
|
|
81 |
* Override of base class virtual
|
|
82 |
*/
|
|
83 |
{
|
|
84 |
return TestStepResult();
|
|
85 |
}
|